esphome-nibe
esphome-nibe copied to clipboard
Fake RMU40 room temperature sensor
I managed to fake RMU40 temperature sensor. Created branch in my repo, [fake-rmu-sensor] (https://github.com/elupus/esphome-nibe/compare/master...egisz:fake-rmu-sensor?expand=1) branch
- Added ~~number template~~ home asssistant sensor entity
rmu40_fake_temp
in esp config file:
# Home Assistant Sensor - https://esphome.io/components/sensor/homeassistant.html
# used to map any HA temperature sensor to pretend as RMU40 room temperature sensor.
# sensor id must be passed to nibegw component
sensor:
- platform: homeassistant
id: rmu40_fake_temp
entity_id: sensor.shellyplusht_08b61fcad31c_temperature # replace to your sensorId
- Added extra nibegw parameter rmu40_fake_temp_sensor_id to map this sensor to nibegw component.
# Configure NibeGW
nibegw:
udp:
target:
...
rmu40_fake_temp_sensor_id: rmu40_fake_temp
- Updated
NibeGwComponent::callback_msg_token_received
function to insert fake sensor's value instead of constant value.
Thats it, now I can control RMU40 sensor from HA ~~both manually adjusting sensor, or by simple automation which triggers on my~~ automatically on each Shelly H&T temperature change.
Yup, this is close to how i thought to do it. But needs to be a bit more generalised.
The 7 offset is strange but known: https://github.com/yozik04/nibe/blob/2278e2e2f71d6078440ecf239eb76b6ce53199fd/nibe/connection/nibegw.py#L691
Yup, this is close to how i thought to do it. But needs to be a bit more generalised.
Yes, this is only proof of concept that it actually works.
I have an idea how to generalise - add new nibegw config category sensors
and put sensors there with same matching to address, token, etc:
nibegw:
<...>
remote_sensors:
- address: RMU40_S1
token: RMU_WRITE
id: sensor.shellyplusht_08b61fcad31c_temperature # HA sensor id
# Constant replies to certain requests can be made
constants:
- address: MODBUS40
token: ACCESSORY
data: [
0x0A, # MODBUS version low
0x00, # MODBUS version high
0x02, # MODBUS address?
]
And then auto generate those sensors automatically with cg. Maybe there will be similar need to implement some other sensor, as humidity as AFAIK Nibe has such. Let me know what you think
I've made an attempt at this too: https://github.com/elupus/esphome-nibe/pull/60 it's getting there :). Set points works too.
I've merged an alternate solution now. Seem to work mostly, very little tests.