Refresh_value automation issues

Hello,

This is my first post here. I have a Qubino ZMNHJD1 with the Qubino Temperature sensor and it seems that the module do not send automatically the value of the temperature when it changes to the controller.

As it is not automatically updated, I tried to create a HA automation but I encounter a weird issue that I do not understand.

The first execution of the refresh_value automation, I can see that the controller is queried and air temperature value is correctly updated. But it only happens once. The following executions say error:type. Here is a more detailed of what I have done and what log was saying :

YAML

	description: ''
	alias: Chauffage - SDB - Test
	trigger: []
	condition: []
	action:
	  - device_id: b6470540e148755505c5ad6a1c3a3888
		domain: zwave_js
		entity_id: sensor.sdb_seche_serviette_air_temperature
		type: refresh_value
	mode: single

16h26 : First automation run

Automation config

	id: '1643377180429'
	alias: Chauffage - SDB - Test
	description: ''
	trigger: []
	condition: []
	action:
	  - device_id: b6470540e148755505c5ad6a1c3a3888
		domain: zwave_js
		entity_id: sensor.sdb_seche_serviette_air_temperature
		type: refresh_value
	mode: single

Run trace
Executed: 28 janvier 2022, 16:26:29

z-wavejs2mqtt debug log

	2022-01-28 16:26:29.189 INFO ZWAVE: Node 46: metadata updated: 49-0-Air temperature
	2022-01-28 16:26:29.192 INFO ZWAVE: Node 46: value updated: 49-0-Air temperature 19.3 => 19.2

HA system log
(empty)

16h28 : 2nd automation run

Run trace

	Executed: 28 janvier 2022, 16:28:30
	Error: 'type'

z-wavejs2mqtt debug log
(empty)

HA system log

	Logger: homeassistant.components.automation.nouvelle_automatisation_2
	Source: components/zwave_js/device_action.py:243
	Integration: Automatisation (documentation, issues)
	First occurred: 16:28:30 (2 occurrences)
	Last logged: 16:28:30

	Chauffage - SDB - Test: Error executing script. Unexpected error for device at pos 1: 'type'
	While executing automation automation.nouvelle_automatisation_2
	Traceback (most recent call last):
	  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step
		await getattr(self, handler)()
	  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 595, in _async_device_step
		await platform.async_call_action_from_config(
	  File "/usr/src/homeassistant/homeassistant/components/zwave_js/device_action.py", line 243, in async_call_action_from_config
		action_type = service = config.pop(CONF_TYPE)
	KeyError: 'type'

16h30 : Third automation run

same as 2nd

16h33 : Automation recreation (I just deleted the action then save then add again the action) + First automation run

Run trace
Executed: 28 janvier 2022, 16:33:20

z-wavejs2mqtt debug log

	2022-01-28 16:33:20.887 INFO ZWAVE: Node 46: metadata updated: 49-0-Air temperature
	2022-01-28 16:33:20.893 INFO ZWAVE: Node 46: value updated: 49-0-Air temperature 19.2 => 19.3

HA system log
(empty)

16h37 : 2nd automation run

Run trace

	Executed: 28 janvier 2022, 16:37:05
	Error: 'type'

z-wavejs2mqtt debug log
(empty)

HA system log

	Logger: homeassistant.components.automation.nouvelle_automatisation_2
	Source: components/zwave_js/device_action.py:243
	Integration: Automatisation (documentation, issues)
	First occurred: 16:37:05 (2 occurrences)
	Last logged: 16:37:05

	Chauffage - SDB - Test: Error executing script. Unexpected error for device at pos 1: 'type'
	While executing automation automation.nouvelle_automatisation_2
	Traceback (most recent call last):
	  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step
		await getattr(self, handler)()
	  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 595, in _async_device_step
		await platform.async_call_action_from_config(
	  File "/usr/src/homeassistant/homeassistant/components/zwave_js/device_action.py", line 243, in async_call_action_from_config
		action_type = service = config.pop(CONF_TYPE)
	KeyError: 'type'

Complete HA system log

2022-01-28 16:37:05 ERROR (MainThread) [homeassistant.components.automation.nouvelle_automatisation_2] Chauffage - SDB - Test: Error executing script. Unexpected error for device at pos 1: 'type'
	Traceback (most recent call last):
	File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step
	await getattr(self, handler)()
	File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 595, in _async_device_step
	await platform.async_call_action_from_config(
	File "/usr/src/homeassistant/homeassistant/components/zwave_js/device_action.py", line 243, in async_call_action_from_config
	action_type = service = config.pop(CONF_TYPE)
	KeyError: 'type'
	2022-01-28 16:37:05 ERROR (MainThread) [homeassistant.components.automation.nouvelle_automatisation_2] While executing automation automation.nouvelle_automatisation_2
	Traceback (most recent call last):
	File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 508, in async_trigger
	await self.action_script.async_run(
	File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1260, in async_run
	await asyncio.shield(run.async_run())
	File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in async_run
	await self._async_step(log_exceptions=False)
	File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step
	await getattr(self, handler)()
	File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 595, in _async_device_step
	await platform.async_call_action_from_config(
	File "/usr/src/homeassistant/homeassistant/components/zwave_js/device_action.py", line 243, in async_call_action_from_config
	action_type = service = config.pop(CONF_TYPE)
	KeyError: 'type'

What version of HA are you using?

Since you’re using z2m, it has value polling built-in. You will probably find it easier just to setup polling there.

Thank you for your answer.

I am using the latest stable version of HA core-2021.12.10 1 supervisor-2021.12.2 installed in a VM on a Debian 10.
Basically I use official z-wavejs add-on. I witched temporarly to z-wavejs2mqtt add-on to diagnose a little bit what was happening.

I tried polling as you adviced me and it correctly works.

Now, I would prefer to continue using z-wavejs official add-on except if there a plan to make z-wavejs2mqtt official !

@pinomat were you ever able to get refresh_value automation to work correctly? I’m having the same problem where the automation on runs once and then it throws the same exact error you are getting.

Hi @ronluna, I added service automation.reload at the end of the actions.

service: automation.reload
data: {}

1 Like