Pool Water Temperature Sensor

Hi,

I made my own Pool temperature sensor using a Fibaro Door/window sensor (FGK104) and a temperature probe (DS18B20). Everything is working well:

image

I want to get a warning when the battery level drops below 15%. I created a binay sensor as follows:

binary_sensor:
  - platform: template
      pool_temperature_sensor_battery_low:
        value_template: "{{ states.zwave.fibaro_system_fgk10x_door_opening_sensor.attributes.battery_level < 15 }}"
        friendly_name: "Pool Temperature Sensor battery is low"

and the following alert that sends an email:

alert:
  pool_temperature_battery:
    name: Pool Temperature Sensor Battery is Low
    entity_id: binary_sensor.pool_temperature_sensor_battery_low
    repeat: 480
    notifiers:
      - gmail_madelinot

EVERYTHING seems to work just fine. I tested with different levels and the binary sensor is working and I do get the email messages. However, I have this cryptic message in my logs:

Could not render template Pool Temperature Sensor battery is low: UndefinedError: 'mappingproxy object' has no attribute 'battery_level'

Does anyone know what that means exactly?

Thanks!

Do you only get that at startup? It may be a case where you need to check the state of the sensor before trying to get an attribute. Without checking the state, during startup issues may appear when trying to access information that doesn’t exist yet.

The other problem could be that you aren’t grabbing the correct attribute because the shape of it’s dictionary differs from what you are requesting.

Can you post a pic of the attributes inside states.zwave.fibaro_system_fgk10x_door_opening_sensor?

Yes, it seems to be only at startup. I was thinking it could be that. Is there a way to check for a specific state (ie Ready or Complete) before assigning a value to a sensor? Maybe with an IF-THEN statement?

Humm… Here is a picture of the attributes:

Thanks!

Yeah, You can add a check to the beginning of your template:

value_template: >
  {% if states.zwave.fibaro_system_fgk10x_door_opening_sensor.state %}
    {{ states.zwave.fibaro_system_fgk10x_door_opening_sensor.attributes.battery_level < 15 }}
  {% else %}
    false
  {% endif %}
1 Like

Great. thanks to you, I ended up using this:

    value_template: >-
      {% if is_state('zwave.fibaro_system_fgk10x_door_opening_sensor', 'ready') or is_state('zwave.fibaro_system_fgk10x_door_opening_sensor', 'sleeping') %}
        {{ states.zwave.fibaro_system_fgk10x_door_opening_sensor.attributes.battery_level < 15 }}
      {%- else -%}
        false
      {% endif %}

and everything seems to work now. Thanks again,

1 Like

I can’t find these sensors anymore. I want to test outdoor fish pond temp, so I’ll try the Fibaro Implant with the same temp sensor used here. Anyone else use the Implant?

Thanks,
Ambi

I’m testing the Fibaro implant now for something else. The main difference if that the implant does not have a battery and requires an external power source. I guess a 9v battery could work but I don’t know how long it would last. In any case, let us know of your results.

BTW, the sensors are still available here: https://www.aartech.ca/fibaro-fgk-104.html

OK, cool.

I see the newer door sensors have temp but use built-in temp and don’t seem to have connections for sensors.

I’ve got the Implant coming, and I’ll see that. It uses an external power supply, and that works for me because this will be outside measuring my fish-pond temp.

I was surprised at the unboxing video for the Fibaro Implant. It’s smaller than a pack of matches…like a big sugar cube! I’m going to stick it in an IP66 junction box with a waterproof power supply, and 3M temp sensors. It can take 6 but maybe I’ll do 2.

Regards,

Ambi

hi, can u tell me which zwave hub device do you use? usb dongel or a zwave gateway…

Aeotec Zwave USB ZStick Gen 5

is it also possible with the zwave.me usb Dongle? c2868fa0-0135-471a-a3e4-61abaf0dc469.CR0,0,300,300_PT0_SX300_

I don’t see why it wouldn’t be possible…