jeatheak / Mitsubishi-WF-RAC-Integration

WF-RAC homeassistant integration
MIT License
138 stars 26 forks source link

General question: automation turn off climate device #122

Closed Dream1975 closed 4 weeks ago

Dream1975 commented 1 month ago

Hi,

First of all thank you for the great plugin, I've been using it for years on my 3 MHI airco's and the plugin never lets me down.

I do have a question however, I made an automation in Home assistant that when you press a button (Leave home) it will turn off all the lights, lock all doors, turn on alarm and... power off any MHL unit that is running. I have done this in the automation section of HA using when "pressing the button" then action turn off climate (https://www.home-assistant.io/integrations/climate) with selecting the only available entitie for each airco namely "climate.airco_* (ps also tried the other device option). The automation works for everything (lights etc) only airco's that are turned on remain that way...

What am I doing wrong in the automation?

mZ738 commented 4 weeks ago

@Dream1975 For me this Action works:

data:
  hvac_mode: "off"
enabled: true
target:
  entity_id: climate.mitsubishi
action: climate.set_hvac_mode
Dream1975 commented 4 weeks ago

Hello,

Thank you for your reply.

When making the automation through the GUI it makes

action: climate.turn_off
metadata: {}
data: {}
target:
  entity_id:
    - climate.airco_slaapkamer
    - climate.airco_woonkamer
    - climate.airco_zolder

Using your example I just tried it by puting it in as:

action: climate.turn_off
metadata: {}
data:
  hvac_mode: 'off'
enabled: true
target:
  entity_id:
    - climate.airco_slaapkamer
    - climate.airco_zolder
    - climate.airco_woonkamer
action: climate.set_hvac_mode

But after running the automation it gives error extra keys not allowed:

Uitgevoerd op: 29 oktober 2024 om 09:03:44 Fout: extra keys not allowed @ data['hvac_mode'] Resultaat: params: domain: climate service: turn_off service_data: hvac_mode: 'off' entity_id:

  • climate.airco_slaapkamer
  • climate.airco_zolder
  • climate.airco_woonkamer target: entity_id:
  • climate.airco_slaapkamer
  • climate.airco_zolder
  • climate.airco_woonkamer running_script: false

When I go back in the yaml I also see that the last line "action: climate.set_hvac_mode" is not there anymore.

I do have 3 airco's in the automation, maybe that is the problem? I think if it works in your case I am very close to get it working I think, maybe just need a pointer in the right direction 😉

mZ738 commented 4 weeks ago

action: climate.turn_off <- remove this

metadata: {} data: hvac_mode: 'off' enabled: true target: entity_id:

Dream1975 commented 4 weeks ago

You're the best... That did it, works now. Thank you