Help me to debug the values


Very basic question: how do I debug the available values of some sensor/switch/entity/whatever?
For example, I spent some last days to understand what parameters, what hierarchy and what value I can get from Locative. I found I can read somehow the state/old_state/time_changed and many many more, but where I can get the debug output for all those params/fields/values?
I can see the states from dev-states, but it’s very limited and I know there’s should be much more relevant info each entity contain…


I’m not sure that’s possible. HASS doesn’t always have the states baked into the components. The event engine is intentionally agnostic that way. It just waits to be fed states. Sometimes, it just gets data that comes from an API, etc. Some things are easy, like you said. Look at the states dev tool and turn a light on and off and see the states… You can sometimes figure these out by checking the docs or taking a look at the code for the component.

The problem is there’s different implementations, sometimes you need quotes, sometimes braces, sometimes you call as states(), sometimes not. Checked already million examples and all of them different in its way.

I think there are just multiple routes to a way that works. If you check the docs, there are some helper functions (like states()). But those don’t affect the base data that comes through.

Be sure to experiment with the template dev tool if you’re trying to work with templates. That’ll let you debug in realtime.

there’s nothing that can help me to find the last_changed of locative. something at least i started to see from restful api api/states/device_tracker.34343DDDD3232XXX

That’s an attribute, not a state. Can’t you see that with template sensor or template trigger?

I don’t use Locative, so I don’t know the exact syntax, but here’s how to get the last_triggered attribute of an automation:

{{ states.automation.whatever_id.attributes.last_triggered }}

Yes, with script it working good, probably the implementation of locative that’s the problem. I think i will bind the locative to some script/sensor and operate it status changes like you mentioned…