panasonic_cc
panasonic_cc copied to clipboard
Using scene on fly won't work as expected
Scenario: I would like to use automation for stopping my air conditioner when windows are opened and turn it on again when closing the window. Easiest way to achieve it is to create scene on the fly and capture states before opening windows with the snapshot_entities parameter
Automation sample:
...
service: scene.create
data:
scene_id: before_open_windows
snapshot_entities:
- climate.living_room
...
Unfortunately with the current implementation, air conditioner will turn on when you close the window even if it was off before you opened the window
Issue comes from that the integration turn on the device when you update the swing_mode, temprature, preset_mode properties:
- https://github.com/sockless-coding/panasonic_cc/blob/master/custom_components/panasonic_cc/panasonic.py#L316
- https://github.com/sockless-coding/panasonic_cc/blob/master/custom_components/panasonic_cc/panasonic.py#L247
- https://github.com/sockless-coding/panasonic_cc/blob/master/custom_components/panasonic_cc/panasonic.py#L258
For fan mode, the behaviour is different, it doesn't turn on the device:
- https://github.com/sockless-coding/panasonic_cc/blob/master/custom_components/panasonic_cc/panasonic.py#L280
As it seems to be the expected behaviour, I won't flag it as a bug but:
- Why changing prop fan mode mode has a different behaviour than others ?
- Could we define an option to disable auto start (
"power": self.constants.Power.On) when changing properties as it is not always the expected behaviour ?
Hi @olivierSemet I have a vague memory of that the power parameter was required to be set to On for the device to honor the other settings. My Panasonic is currently not operational (Hopefully I get it fixed soon), so I can not verify this (and it might have changed).
Hi @sockless-coding,
Tested this morning with pcomfortcloud app, it works well without turning ON devices:
pcomfortcloud <email> <pwd> get 6
reading from device 'salon' (xxx)
id : xxxx
parameters
temperatureInside : 18
temperatureOutside : 21
temperature : 21
power : Off
mode : Cool
fanSpeed : HighMid
airSwingHorizontal : Mid
airSwingVertical : DownMid
eco : Auto
nanoe : Off
pcomfortcloud <email> <pwd> set -t 27 6
pcomfortcloud <email> <pwd>get 6
reading from device 'salon' (xxx)
id :xxx
parameters
temperatureInside : 18
temperatureOutside : 21
temperature : 27
power : Off
mode : Heat
fanSpeed : HighMid
airSwingHorizontal : Mid
airSwingVertical : DownMid
eco : Auto
nanoe : Off
I tested other parameters than temperature.
To fix my issue with automations and dynamic scenes, I added an option which I called CONF_ENABLE_AUTO_POWER_ON. By default this option is activated to keep the actual behaviour. It works fine except if you enable this option, there is no way to switch ON devices on thermostat widgets. I might need to implement a custom component working like the one from the official comfort cloud mobile app. Other solution is do an exception for parameter mode. When changing mode, we can still turn ON devices. I'll do a PR if you're interested by those changes.