Hi @Zetor77,
I am running a Pi Zero W with Hassbian for controlling the Calima.
So I have just put PatrickE94’s interface into a folder and then created a couple of scripts I can call with the command line sensor. I then control in Node-Red via homeassistant.update_entity service, based on various rules.
I am also pretty new to python so it can probably be done a lot nicer.
In this example I am first setting the boost mode to On, 1000RPM, 600 seconds, and then giving it some time to update its state before I return the new state and boost mode to the sensor.
from pycalima.Calima import Calima
import sys
import time
start_time = time.time()
fan = Calima("MA:CC:AD:DR:ES:SS", "012345")
fan.setBoostMode(1, 1000 , 600)
time.sleep(5)
print(fan.getState())
print(fan.getBoostMode())
fan.disconnect()
print("--- %s seconds ---" % (time.time() - start_time))
configuration.yaml:
- platform: command_line
name: fan_setboost_1000_and_getstate
command: "python3 /home/homeassistant/.homeassistant/pycalima/calima_set_boost_mode_on_1000_and_get_state.py"
value_template: '{{ value }}'
scan_interval: 30000000
command_timeout: 30
Output:
FanState(Humidity=12, Temp=23.75, Light=2, RPM=1211, Mode='Boost')
BoostMode(OnOff=1, Speed=1000, Seconds=590)
--- 19.512956142425537 seconds ---