Thank you @kiwijunglist, that solved my problem
I wanted some help with an automation, but I figured out on my own so I’ll post the example here:
- alias: 'Turn off AC if no motion for 90 minutes'
trigger: # trigger if motion sensor off for 90 minutes
platform: state
entity_id: binary_sensor.motion_sensor_158d0001dc7526
to: 'off'
for:
minutes: 90
condition: # check aircon isn't already idle, if you use the original aircon remote as well as H.A. then you should probably skip this condition, this is because the AC might be set to ON without H.A. knowing it is already on.
- condition: template
value_template: "{{ not is_state('climate.panasonic_aircon', 'idle') }}"
action: # turn the AC to idle mode
service: climate.set_operation_mode
data:
entity_id: climate.panasonic_aircon
operation_mode: idle
PS: This is my first automation =)
Can I please request this is added to the wiki page, I’m sure it would help a lot of people.
@bengt you’re welcome
I had an idea to improve the functionality of my air conditioner with the broadlink component. Sometimes you don’t know if the aircon is on (ie if it was turned on via the original IR remote).
You can put a xiaomi door sensor on the duct of the air conditioner. It can sense whether the airconditioner is on or off. Is there any way this can be easily integrated into the existing climate control. I was wondering if we could add an additional state called “on” that doesn’t have an IR code.
The logic would be
If xiaomi door sensor from closed to open , then check broadlink cimate aircon state. If currently idle then set state to “on” if not idle then do nothing.
If xiaomi door sensor from open to closed, then check broadlink climate airconst ate. If currently not idle then set state to idle.
Is there a way to set the climate aircon state through automation.yaml ?
That’s a great idea, I will probably do something like that. I even have an extra wireless door sensor. I think you could set the state through automation, but what temperature would you set it at? As you know, the AC can not report back to the Braodlink unit what temperature it is set at. Maybe use the target temp defined in the YAML config file but what could be set using the AC remote control could be different…
Yes. You only know that it is on. You don’t know operation mode, target temp, or fan speed.
I’d set it as
Operation mode: on
Temp:
Fan speed:
For temp i think I’d leave it blank, you could use “unknown” for temp, or just leave it at the current numerical value. I don’t think it’s that important to know the target temp, just the fact that it is on should be enough for most automations.
I found you can set the state and attributes of the climate entity in the states tab of the web interface using a web api call with a json string. I have not idea how to put that action into automation.yaml though.
I have asked the question here:
But haven’t had any replies yet.
using open close sensor to detect the state (on/off) of a dumb aircon is a brilliant idea. unfortunately it is not supported by this custom component. i hope this can be supported soon. perhaps it can do something similar to Switch Template where it uses value_template
to determine the state of the switch.
You can actually change the state using an api call so it is “supported”, in a way.
Mind to share how to do that?
It’s in the link about 4 posts above. I can change it with the web gui , but haven’t figured out how to write that into an api call in an automation yet. (I’m waiting for an expert to help).
I’m no expert, but I will install the open/close sensor soon and try to figure it out… Even if it’s not integrated into the custom component, it is still useful to have separately.
I got started on this the command is gonna be something like this:
(I shortened the attributes list to make the example code smaller).
Configuration.yaml
rest_command:
set_climate_state_idle:
method: POST
url: 'https://xxxxxx.duckdns.org:8123/api/states/climate.panasonic_aircon'
password: 'xxxxxx'
content_type: application/json
payload: '{
"state": "idle",
"attributes": {
"fan_mode": "auto",
"operation_mode": "idle"
}
}'
Automation.yaml
- alias: set climate state to idle when aircon turns off
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0001f38b1f
from: 'on'
to: 'off'
condition:
- condition: template
value_template: "{{ not is_state('climate.panasonic_aircon', 'idle') }}"
action:
- service: rest_command.set_climate_state_idle
unfortunately there are some syntax errors in the rest_command, and I haven’t figured it out.
@masterkenobi - you can use this as it works.
OK i managed to use the door sensor to ‘update’ the broadlink climate control. I had to make an extra mode called ‘on’ in the configuration.yaml and the panasonic_ir_code.ini. The ini file for the IR codes had to have a lot of dummy entries for the new operation mode. Note this setup uses ‘off’ rather than ‘idle’.
This is obviously not the ideal way to do this, so if anyone can figure out how to update the climate entity state and attributes without actually calling the climate service, then this would be ideal (see above post, on how far i got trying to figure it out). If you can use the restful api call then you don’t have to add the dummy codes to the ini file. I tried to get some help here as well - Help with home assistant api call
What it does:
- If your airconditioner is turned on using the original remote (regardless of whether it is cool or hot or fan mode), then the climate control will change to ‘on’.
- If your airconditioner is turned to off using the original remote, then the climate control will change to ‘off’
Configration.yaml
climate:
- platform: broadlink
name: Panasonic Aircon
host: 192.168.178.81
mac: '34:EA:34:58:AA:65'
ircodes_ini: 'broadlink_media_codes/panasonic_CS-RE_GKE.ini'
min_temp: 16
max_temp: 30
target_temp: 20
temp_sensor: sensor.temperature_158d0001f52edb
default_operation: idle
default_fan_mode: mid
customize:
operations:
- 'off'
- cool
- heat
- 'on'
fan_modes:
- low
- mid
- high
- auto
Automation.yaml
- alias: 'Update AC to off if turned off on the remote control'
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0001fd55d5
from: 'on'
to: 'off'
for:
seconds: 1
condition:
- condition: template
value_template: "{{ not is_state('climate.panasonic_aircon', 'off') }}"
action:
service: climate.set_operation_mode
entity_id: climate.panasonic_aircon
data:
operation_mode: 'off'
- alias: 'Update AC to on if turned on with the remote control'
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0001fd55d5
from: 'off'
to: 'on'
for:
seconds: 1
condition:
- condition: template
value_template: "{{ is_state('climate.panasonic_aircon', 'off') }}"
action:
service: climate.set_operation_mode
entity_id: climate.panasonic_aircon
data:
operation_mode: 'on'
panasonic_ircodes.ini with dummy entries : https://pastebin.com/fL5jNULw
the hack wont work unless you add the dummy entries, otherwise you can’t set it to ‘on’ mode.
hi, can you share the .ini file of the haier air conditioner? thank you so much
@Vassilis,
Is there any way to get current state/status of devices attached to broadlink?
Please guide if theres any way,
Thanks in adv.
No, there is no way. If you read it, this thread above suggested to attach a wireless door/window sensor to the AC unit to know when it’s off or on. But temperature, there is no way.
This is a custom component. Read this to install it:
https://www.home-assistant.io/developers/component_loading/
I have it under HASSio, no issues.
I’ve put in a pull request to add the Carrier RG56V/BGEF. I think this also works with some Midea and Toshiba variants.
Searching Hitachi ac codes