Automation for z-wave Heiman Combustible Gas Sensor HS1CG-Z

I have a Heiman Combustible Gas Sensor HS1CG-Z (you can also find it as Zipato gas sensor).
The entities are:

  • sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level
  • sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_type

They alway remains zero.

I made the following automation

- alias: 'Gas Alarm'
  trigger:
  - entity_id: sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level
    platform: state
  action:
  - data:
      message: gas {{ states.sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level.state }}
      title: gas
    service: persistent_notification.create 

If I put the sensor in alarm, the automation is triggered, even if the sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level.state remains zero.

But every time I restart Home assistant the automation is triggered as well.

How can I manage this sensor? I’d like to make an automation to close the gas valve, but not if the alarm is triggered on every reboot.

So I think what you need to do is set the value for the sensor you wish to trigger the automation. Having it without one will trigger it every time as on startup HA will loop through all your automations. Try something like…

trigger:
- entity_id: sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level
  platform: state
  to: WHATEVER THE TRUE VALUE IS HERE

I don’t have this sensor so I don’t know the exact value but if it’s similar to the Heiman door sensor I have then it will be a numeric value like 23 or something.

But the problem is that I don’t have a “to” value to put in: the value is always zero, even when the sensor is in alarm state.
The history of the sensor is always zero. But a status change is happening, since the automation is triggered when I flood the sensor with gas.

Now I’m not home, but I rememenber that some alarm event is logged on OZW_Log.txt
So I will try to use the following trigger:

- platform: event
  event_type: zwave.node_event
  event_data:
    entity_id: zwave.heiman_combustible_gas_sensor_hs1cgz
    basic_level: [I must check the log file]

Ok, the log says
2018-08-09 18:10:22.726 Detail, Node013, Received: 0x01, 0x0f, 0x00, 0x04, 0x00, 0x0d, 0x09, 0x71, 0x05, 0x00, 0x00, 0x00, 0xff, 0x12, 0x02, 0x00, 0x6b
2018-08-09 18:10:22.727 Detail,
2018-08-09 18:10:22.727 Info, Node013, Received Alarm report: type=0, level=0, sensorSrcID=0, type:Unknown type event:2, status=255
2018-08-09 18:10:22.727 Detail, Node013, Initial read of value
2018-08-09 18:10:22.728 Detail, Node013, Initial read of value
2018-08-09 18:10:22.728 Detail, Node013, Initial read of value
2018-08-09 18:10:22.729 Detail, Node013, Notification: ValueChanged
2018-08-09 18:10:22.764 Detail, Node013, Notification: ValueChanged
2018-08-09 18:10:22.793 Detail, Node013, Notification: ValueChanged

How can I intercept this event?

Maybe [https://www.home-assistant.io/docs/z-wave/events/#zwavenode_event](an event) with an event trigger? You’ll need to check the Home Assistant (console) log to see what the event is.

The event is

Node013, Received Alarm report: type=0, level=0, sensorSrcID=0, type:Unknown type event:2, status=255

but I don’t know how to get it. Alarm level and type are 0.
The status is always 255.
Only the type changes from “Unknown type event:2” to “Unknown type event:0”
It seems a not completely supported node.

Now I’m using the following workaround:

input_boolean:
  enable_gas_alarm:
  initial: off

- alias: 'Gas Alarm'
  trigger:
   - entity_id: sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level
     platform: state
  condition:
  - condition:  state
    entity_id: input_boolean.enable_gas_alarm
    state: 'on'
  action:
  - data:
      message: 'Allarme gas in cucina'
    service: notify.telegram

- alias: 'Enable Gas Alarm'
  hide_entity: true
  trigger:
    - entity_id: sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level
      platform: state
  condition:
    - condition:  state
      entity_id: input_boolean.enable_gas_alarm
      state: 'off'
  action:
    - service: homeassistant.turn_on
      entity_id:
        - input_boolean.enable_gas_alarm

That’s not an event from the HA log, but from the OZW log :wink: You need the HA event.

This is the output of the logger in “info” level:

2018-08-25 15:52:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=zwave.heiman_combustible_gas_sensor_hs1cgz, 
old_state=<state zwave.heiman_combustible_gas_sensor_hs1cgz=ready; node_id=13, node_name=Heiman Combustible Gas Sensor HS1CG-Z, manufacturer_name=Heiman, product_name=Combustible Gas Sensor HS1CG-Z, query_stage=Complete, is_awake=True, is_ready=True, is_failed=False, is_info_received=True, max_baud_rate=40000, is_zwave_plus=True, capabilities={'beaming', 'routing', 'listening', 'zwave_plus'}, neighbors={8, 1, 11, 16}, sentCnt=8, sentFailed=0, retries=0, receivedCnt=3, receivedDups=0, receivedUnsolicited=0, sentTS=2018-08-25 15:48:54:400 , receivedTS=2018-08-25 15:48:54:339 , lastRequestRTT=32, averageRequestRTT=43, lastResponseRTT=47, averageResponseRTT=82, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:49:57.646341+02:00>, 
new_state=<state zwave.heiman_combustible_gas_sensor_hs1cgz=ready; node_id=13, node_name=Heiman Combustible Gas Sensor HS1CG-Z, manufacturer_name=Heiman, product_name=Combustible Gas Sensor HS1CG-Z, query_stage=Complete, is_awake=True, is_ready=True, is_failed=False, is_info_received=True, max_baud_rate=40000, is_zwave_plus=True, capabilities={'beaming', 'routing', 'listening', 'zwave_plus'}, neighbors={8, 1, 11, 16}, sentCnt=8, sentFailed=0, retries=0, receivedCnt=4, receivedDups=0, receivedUnsolicited=1, sentTS=2018-08-25 15:48:54:400 , receivedTS=2018-08-25 15:52:33:436 , lastRequestRTT=32, averageRequestRTT=43, lastResponseRTT=47, averageResponseRTT=82, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:49:57.646341+02:00>>

2018-08-25 15:52:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_type, 
old_state=<state sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_type=0; node_id=13, value_index=0, value_instance=1, value_id=72057594262077441, unit_of_measurement=, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z Alarm Type, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:46:05.847679+02:00>, 
new_state=<state sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_type=0; node_id=13, value_index=0, value_instance=1, value_id=72057594262077441, unit_of_measurement=, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z Alarm Type, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:52:33.560981+02:00>>

2018-08-25 15:52:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level, 
old_state=<state sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level=0; node_id=13, value_index=1, value_instance=1, value_id=72057594262077457, unit_of_measurement=, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z Alarm Level, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:46:05.892013+02:00>, 
new_state=<state sensor.heiman_combustible_gas_sensor_hs1cgz_alarm_level=0; node_id=13, value_index=1, value_instance=1, value_id=72057594262077457, unit_of_measurement=, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z Alarm Level, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:52:33.566007+02:00>>

2018-08-25 15:52:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.heiman_combustible_gas_sensor_hs1cgz_sourcenodeid, 
old_state=<state sensor.heiman_combustible_gas_sensor_hs1cgz_sourcenodeid=0; node_id=13, value_index=2, value_instance=1, value_id=72057594262077473, unit_of_measurement=, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z SourceNodeId, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:46:05.936676+02:00>, 
new_state=<state sensor.heiman_combustible_gas_sensor_hs1cgz_sourcenodeid=0; node_id=13, value_index=2, value_instance=1, value_id=72057594262077473, unit_of_measurement=, friendly_name=Heiman Combustible Gas Sensor HS1CG-Z SourceNodeId, custom_ui_state_card=state-card-custom-ui @ 2018-08-25T15:52:33.572411+02:00>>
ecuted[L]>

There is a state update event, that I can use as trigger, but the value does not change.

The state trigger without to: or from: will trigger on every update.

Have you tried triggering the sensor to see what happens then?

Looking at your first post, there may be other issues too, but because you’re templating, you need to use data_template: instead of data:

I am sure @Tinkerer will correct me if my information is antiquated. :slight_smile:

For example, here’s a snippet from one of my automation actions:

    action:
	  - service: notify.html5
		data_template:
		  message: "Please water the peace lilly. Its soil moisture is now at {{ states.sensor.peace_lilly_moisture.state }} percent."
		  title: "Water Plant"

The following is better, because states('this.thing') handles errors (like the entity not being initialised yet) where states.this.thing.state doesn’t.

    action:
	  - service: notify.html5
		data_template:
		  message: "Please water the peace lilly. Its soil moisture is now at {{ states('sensor.peace_lilly_moisture') }} percent."
		  title: "Water Plant"

In this case, because the same sensor is triggering the automation it’s unlikely to matter.

1 Like

Fabio72, did you get the Heiman HS1CG Z to work with home assistant?

Did someone knows how to integrate this gas sensor? I have exactly the same results as @Fabio72. The only change is the type event: from 2 to 0. Is there an option to get this values in template sensor?

Hey all, coming in for the annual check up if anyone has figured this thing out? @Fabio72, how did you get the alarm_level sensor? I only get one sensor who’s value is always 0:

sensor.heiman_technology_co_ltd_combustible_gas_sensor_hs1cg_z_sourcenodeid

I feel like it must be possible via node groups or changing something in the zwave config like changing its configuration from Basic Set (default) to Alarm report as mentioned here but I can’t figure out how to do it.

It’s not possible for this device to work with the legacy zwave integration; zwave (OZW 1.4) is too old and doesn’t support V7 Notification CC. Switch to zwave-js if you want to use it.

The best you can do is the example with the input boolean. zwave sensors support forced updates, which means HA will record a state even if the value doesn’t change. So you’ll get a state trigger when the alarm turns on, and another state trigger when it turns off, but the state will never change, so you can’t know the value unless you track it manually.

1 Like

Okay, that’s good news that it will work with Zwave-js at least. I’m holding off a bit longer to update, but I can live without the zwave connection to the gas sensor for a bit since at least the alarm will work.

So you’ve tried it on ZwaveJS and you can get a working sensor out of it?

I don’t own the device, but I know that OZW 1.4 doesn’t support the notification CC version 7, which this device uses to report alarms (see zwave db or the user manual). Apparently the device does not support v1 alarms either, otherwise you’d see level and type values change.

zwave-js supports notification cc v7 just fine, and the zwave_js integration is written to automatically create binary sensors for the Gas notification type, which is what the device reports.

1 Like

hello,
what is the fix / solution here?

Assuming its not working properly?

Can anyone suggest some better gas sensor? Thanks!