I’m trying to create a sensor for my car’s 'distance until service required". I’ve successfully added the Jaguar integration and can see all of the entities. I’ve run the templating tool and verified that my ‘state’ line works and correctly pulls the distance, but for some reason the sensor is not created. I’m sure I’m doing something stupid… can anyone help?
Because you’re still mixing legacy format with modern format. Compare the first two lines of the posted example (modern format) with your version (legacy format).
Thanks for the reply. I’ve updated and was able to create the sensor by moving it into configuration.yaml. I couldn’t quite figure out the format to put it in my split sensors.yaml file.
Also, the value is showing as ‘unavailable’ even though pasting
Usually the sensors.yaml file sets a top level key of sensor: so it is not compatible with the current method which needs that to be template:. As Taras commented above you will need to use the legacy format if you want it to be in that file. Optionally, you could use the current format and keep you configuration.yaml file tidy by setting up a templates.yaml file and !include-ing it in your config.
As Pete’s comment alludes, the attribute might be coming through as a string so you may need to cast it to an integer or float to have availability work correctly.