mduran80 / pymadoka

A python library to control Daikin BRC1H (Madoka) thermostat
MIT License
26 stars 8 forks source link

Small issues #16

Open rekkebus opened 1 year ago

rekkebus commented 1 year ago

Hi,

Have done some testing.

Fixed some small issues with some trial and error coding:

  1. static discovery variables don't end up in the discovery message, since they don't end up in vars()-statement. I defined them under init to make it work.

removed the power_command_topic, HA says it is deprecated; fan_mode_state_template had fan state medium defined as MEDIUM, should be MID

  1. via_device under device info returns a list which HA does not expect, it needs a string. Made identifiers and via_device a string.

  2. Added LWT so that on disconnect HA knows the connection is broken:

  3. Trailing / in device topics in the .yaml file still give weird results in my HA setup.

Thanks gitpatch.txt

alexcf commented 1 year ago

Thanks for putting this together. It fixed a bunch of issues! That said, I wasn't able to "turn off" my Madokas with this. I made a minor change:

-        mode_state_template: str =  "{% set values = {None:None,'off':'off','HEAT':'heat','COOL':'cool','FAN':'fan_only', 'AUTO':'auto', 'DRY':'dry'} %} {{values[value_json.operation_mode['operation_mode']] if value_json.power_state['turn_on'] else 'off' }}"
+        mode_state_template: str =  "{% set values = {None:None,'OFF':'off','HEAT':'heat','COOL':'cool','FAN':'fan_only', 'AUTO':'auto', 'DRY':'dry'} %} {{values[value_json.operation_mode['operation_mode']] if value_json.power_state['turn_on'] else 'off' }}"

I haven't managed to get the heat component working, but cooling is what I need for now!