Hello everyone
i need some help with a function node i need the (brightness: 88) and i cant see what im doing wrong
TypeError: Cannot read property 'new_state' of undefined
var temp=payload.event.new_state.attributes.brightness; var msg = {payload:temp}; return msg;
{"event_type":"state_changed","entity_id":"light.fibaro_system_fgd212_dimmer_2_level_3","event":{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_3","old_state":{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_3","state":"off","attributes":{"node_id":3,"value_index":0,"value_instance":1,"value_id":"72057594093076481","power_consumption":0,"friendly_name":"Conservatory Wall Lights","supported_features":33},"last_changed":"2018-09-14T15:54:26.450143+00:00","last_updated":"2018-09-14T15:54:29.211623+00:00","context":{"id":"cc8abcc7961e4d2a9ae3945d4352c035","user_id":"51cd628db86c457ea8d904f8e85ec031"}},"new_state":{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_3","state":"on","attributes":{"brightness":88,"node_id":3,"value_index":0,"value_instance":1,"value_id":"72057594093076481","power_consumption":0,"friendly_name":"Conservatory Wall Lights","supported_features":33},"last_changed":"2018-09-14T15:54:34.742960+00:00","last_updated":"2018-09-14T15:54:34.742960+00:00","context":{"id":"caf54b82fd6247d881254e39edeeb0fb","user_id":"51cd628db86c457ea8d904f8e85ec031"}}}}
`
9/14/2018, 4:54:36 PMnode: 4c0696d1.8f5fe8state_changed : msg.payload : Object
object
event_type: "state_changed"
entity_id: "light.fibaro_system_fgd212_dimmer_2_level_3"
event: object
entity_id: "light.fibaro_system_fgd212_dimmer_2_level_3"
old_state: object
new_state: object
entity_id: "light.fibaro_system_fgd212_dimmer_2_level_3"
state: "on"
attributes: object
<brightness: 88
<node_id: 3
<value_index: 0
<value_instance: 1
<value_id: "72057594093076481"
<power_consumption: 0
<friendly_name: "Conservatory Wall Lights"
<supported_features: 33
last_changed: "2018-09-14T15:54:34.742960+00:00"
last_updated: "2018-09-14T15:54:34.742960+00:00"
context: object
id: "caf54b82fd6247d881254e39edeeb0fb"
user_id: "51cd628db86c457ea8d904f8e85ec031"
`