-
-
Notifications
You must be signed in to change notification settings - Fork 17
5.1 Faking Sensors
NOTE: This feature is a WIP. Faking v2 has just been released in version 0.31.x.
Options for sensor faking include:
- zone temperature sensor for CH/DHW systems
- DHW temperature sensor for CH/DHW systems
- relative humidity sensor for HVAC systems
- CO2 level sensor for HVAC systems
- occupancy/presence sensor for HVAC systems
If you are not impersonating an existing device, you will have to 'create' a virtual device and bind it to your controller / ventilation unit.
After you have bound a faked sensor, ramses_rf will not likely have updated its schema to match these changes. This is relevant for CH/DHW systems such as evohome.
Note: You should not explicitly declare these bindings in your configuration.yaml.
Thus, you should restart HA at some stage, possibly with a disabled schema cache:
ramses_cc:
restore_cache:
restore_schema: false
This will be especially true if you intend to use the convenience service calls instead of their corresponding primitives (see below).
If you are replacing an EVOTOUCH SENSOR
with a faked sensor, you should remove that entry from your configuration schema before restarting HA.
Note: You should not explicitly declare these bindings in your configuration.yaml.
Please ensure you have read and understand the schema notes elsewhere in this wiki.
To complete a bind, the sensor must cast a 10E0
packet, otherwise binding will fail. The packets are vendor/device-specific and you will need to know which to use (see below).
The client library, ramses_rf, has a feature where if it doesn’t hear from a device for a while (on a per command-code basis), then it treats that value as unknown. These tombstone timers are usually 2.1x the expected interval between such packets.
That is (for example), it is better to not know the temperature of a room than it is to believe the room is (say) 15 'C simply because it was so, 4 hours ago. It could be 20 'C at present!
This emulates the normal behaviour of your Heating / HVAC system.
This is why we use two triggers for faked sensors:
- id: cast_faked_sensor
trigger:
- platform: state
entity_id: sensor.source_reading # whenever the value changes changes...
- platform: time_pattern
minutes: /15 # ... and also every 15 minutes
action:
- service: ramses_cc.put_... # e.g. ramses_cc.put_room_temp, ramses_cc.put_dhw_temp, etc.
Some of the primitive put_*
service calls have a convenience wrapper:
-
ramses_cc.fake_zone_temp
forramses_cc.put_room_temp
(uses the entity_id of the climate entity) -
ramses_cc.fake_dhw_temp
forramses_cc.put_dhe_temp
(uses the entity_id of the water heater entity)
Note: The
fake_
service calls require an up-to-date schema (the primitive service calls do not).
The source sensor used to obtain the readings could be unavailable
under certain circumstances, and the data template needs to handle this edge case by converting 'unavailable' to None.
...
action:
- service: ramses_cc.put_room_temp # e.g. ramses_cc.put_dhw_temp, ramses_cc.put_humidity, etc.
data:
entity_id: sensor.03_123456_temperature # e.g. sensor.07_123456_temperature, sensor.32_123456_humidity, etc.
temperature: >-
{% if states('sensor.source_reading') == 'unavailable' -%}
{{ None }}
{%- else -%}
{{ states('sensor.source_reading') | float }}
{%- endif %}
Note: Replace
sensor.source_reading
with the entity_id of your (non-evohome) sensor.
To declare a faked room temperature sensor called 03:123456
, add this configuration.yaml entry and restart HA:
ramses_cc:
known_list:
03:123456: {class: THM, faked: true} # device type must be 03 (recommended), 12, 22 or 34
To bind the sensor, put the CH/DHW controller in bind mode, and invoke this service call:
service: ramses_cc.bind_device
data:
device_id: "03:123456" # use the device id of your sensor
offer: {30C9: null}
At some later stage, you may have to restart HA, to effect the new schema.
Successful bindings will have an I-W-I
sequence in the packet log similar to:
> ~ cat config/packet.log | grep ' 1FC9 '
15:27:30.775 000 I --- 03:123456 --:------ 03:123456 1FC9 012 0030C90DE240001FC90DE240
15:27:30.789 032 W --- 01:145038 03:123456 --:------ 1FC9 006 00230906368E
15:27:30.794 000 I --- 03:123456 01:145038 --:------ 1FC9 001 00
Note: Before invoking
ramses_cc.fake_zone_temp
, you may have to restart HA to effect any changes to the schema.
To fake the sensor reading, call ramses_cc.bind_device
with this service data:
service: ramses_cc.put_room_temp
data:
entity_id: sensor.03_123456_temperature
temperature: 21.3
Successful announcements will have an entry in the packet log similar to:
15:55:53.219 000 I --- 07:123456 --:------ 07:123456 1260 003 0018C4
The updated temperature should appear in the CH/DHW controller UI within a minute.
To declare a faked DHW temperature sensor called 07:123456
, add this configuration.yaml entry and restart HA:
ramses_cc:
known_list:
07:123456: {class: DHW, faked: true} # device type must be 07
To bind the sensor, put the CH/DHW controller in bind mode, and invoke this service call:
service: ramses_cc.bind_device
data:
device_id: "07:123456" # use the device id of your sensor
offer: {1260: null}
At some later stage, you may have to restart HA, to effect the new schema.
Successful bindings will have an I-W-I
sequence in the packet log similar to:
> ~ cat config/packet.log | grep ' 1FC9 '
15:32:13.181 000 I --- 07:123456 --:------ 07:123456 1FC9 012 0012601DE240001FC91DE240
15:32:13.196 034 W --- 01:145038 07:123456 --:------ 1FC9 006 0010A006368E
15:32:13.276 000 I --- 07:123456 01:145038 --:------ 1FC9 001 00
Note: Before invoking
ramses_cc.fake_dhw_temp
, you may have to restart HA to effect any changes to the schema.
To fake the sensor reading, call ramses_cc.bind_device
with this service data:
service: ramses_cc.put_dhw_temp
data:
entity_id: sensor.07_123456_temperature # NB: is not 07_123456_dhw_temp
temperature: 63.4
Successful announcements will have an entry in the packet log similar to:
15:36:31.492 000 I --- 03:123456 --:------ 03:123456 30C9 003 000852
The updated temperature should appear in the CH/DHW controller UI within a minute.
To bind the sensor, put the ventilation into bind mode, and invoke this service call:
...