deiger / AirCon

Scripts for controlling Air Conditioners, e.g. with HiSense modules.
GNU General Public License v3.0
218 stars 58 forks source link

Fujitsu FGLair swing modes available #187

Open Stef42300 opened 2 years ago

Stef42300 commented 2 years ago

Hello,

One of my model supports 6 angles of vertical airflow + sweep and this doesn't work with AirCon. I want to use the differents swings modes I have in my FGLair app for my air conditionner but there is only one swing mode available ('on' or 'off'). Can we customize this with swing modes which are in FGLair app (for example : Vertical 6) ?

http://image.noelshack.com/fichiers/2022/31/3/1659538549-297263823-10160050735682661-1181139911537222470-n.jpg

Thanks for your help

justinbyoung commented 2 years ago

You may have seen my reply in the older issue I commented in, but in case it is useful for other people and to make it more visible I will paste how I did this in this comment as well.

Thanks to this brilliant application exposing so much funtionality with MQTT it is possible to send the unit commands outside of the scope of other solutions. It doesn't seem like airflow control is a consideration for thermostat/climate control in Home Assistant so I set up my own using some buttons in HA that send MQTT commands.

I have been able to send MQTT commands to control the airflow direction with my Fujitsu heatpump.

hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/command

Here is an example of a button card I have currently set up in HA. My Fujistsu Heat Pump current has eight vertical positions. This button sets it to 8 or the lowest.

show_name: true show_icon: true type: button tap_action: action: call-service service: mqtt.publish service_data: topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command payload: '8' target: {} name: '8'

You can also pull the current position from hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/status.

I haven't quite worked out a nice UI yet, I just have buttons for each postion. None of the thermostat cards support airflow direction. Maybe some drop down menus would work well.

Stef42300 commented 2 years ago

You may have seen my reply in the older issue I commented in, but in case it is useful for other people and to make it more visible I will paste how I did this in this comment as well.

Thanks to this brilliant application exposing so much funtionality with MQTT it is possible to send the unit commands outside of the scope of other solutions. It doesn't seem like airflow control is a consideration for thermostat/climate control in Home Assistant so I set up my own using some buttons in HA that send MQTT commands.

I have been able to send MQTT commands to control the airflow direction with my Fujitsu heatpump.

hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/command

Here is an example of a button card I have currently set up in HA. My Fujistsu Heat Pump current has eight vertical positions. This button sets it to 8 or the lowest.

show_name: true show_icon: true type: button tap_action: action: call-service service: mqtt.publish service_data: topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command payload: '8' target: {} name: '8'

You can also pull the current position from hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/status.

I haven't quite worked out a nice UI yet, I just have buttons for each postion. None of the thermostat cards support airflow direction. Maybe some drop down menus would work well.

Ok I installed MQTT Explorer to test it and it works but I tried to put your code on a card on HA but I have an error...can you help me ?

type: custom:button-card icon: mdi:air-purifier tap_action: action: call-service service: mqtt.publish service_data: topic: hisense_ac/a0c9a00da8f9/af_vertical_direction/command payload: '6' target: {} name: '6' name: Volet vertical

I have this error : "mqtt/publish". extra keys not allowed @ data['target']

justinbyoung commented 2 years ago

I just realised copying from the other issue didn't transfer the yaml formatting, so possibly that is the issue. Let me try again.

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: mqtt.publish
  service_data:
    topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command
    payload: '8'
  target: {}
name: '8'
justinbyoung commented 2 years ago

I think target: is indented under service_data in your yaml. I changed my yaml to that and got the same error.

justinbyoung commented 2 years ago

You can also create a mqtt sensor that will tell you the current airflow direction.

https://www.home-assistant.io/integrations/sensor.mqtt/

e.g.

mqtt:
  sensor:
    - name: "Heat Pump Horizontal Airflow"
      state_topic: "hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/status"
justinbyoung commented 2 years ago

I have also using mqtt select to create a dropdown to change the settings.

https://www.home-assistant.io/integrations/select.mqtt/

select:
  - name: "Heat Pump Vertical Select"
    command_topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command
    state_topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/status
    options:
      - "1"
      - "2"
      - "3"
      - "4"
      - "5"
      - "6"
      - "7"
      - "8"
  - name: "Heat Pump Horizontal Select"
    command_topic: hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/command
    state_topic: hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/status
    options:
      - "1"
      - "2"
      - "3"
      - "4"
      - "5"
justinbyoung commented 2 years ago

Have played around a bit more with this. Using an MQTT Number you can create a slider to adjust the airflow on your dashboard.

number:
  - name: "Heat Pump Vertical Number"
    command_topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/command
    state_topic: hisense_ac/a0cc2bdf7b9a/af_vertical_direction/status
    retain: true
    min: 1
    max: 8
    step: 1
  - name: "Heat Pump Horizontal Number"
    command_topic: hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/command
    state_topic: hisense_ac/a0cc2bdf7b9a/af_horizontal_direction/status
    retain: true
    min: 1
    max: 5
    step: 1

image