sensor:
- platform: command_line
name: SE4 Malmo Electricity Spot Price Text
command: curl -s 'https://elen.nu/dagens-spotpris/se4-malmo/' | grep -A 1 "`date +'%Y-%m-%d %H:00'`" | sed 's/,/./g'
scan_interval: 3600
What is the difference between the “sensor” in this case?
Why is the sensor in the first example under template?
Could I also have a template under “sensor” in the second exampel?
Also, why is “platform:” sometimes needed?
If anyone can link to a training material on these topics it would be great… now I gut and pase and sometines not really knowing what I am doing…
Sensor is an integration. It supports many platforms like, command_line, restful, template, etc. Each of these platforms provide a different way to make a sensor.
Somewhat confusingly, “template” is now an integration too (as well as a platform). It supports binary sensors, sensors and triggered sensors.
Thanks a lot.
Is there a clean definition on what is a “integration” compared to what is a “platform”?
Like for cameras.
camera: (I suppose this is the integration)
- platform: generic
stream......
What does "camera: tell home assistant and what does platform do?
"Camera is the integration I understand from the post but what does it mean for home assistant?
Is it that all entity definitions below the integration will become a “camera”?
Can I somewhere see what platforms different integrations supports?
An integration is something you can integrate into home assistant, like a light or camera or switch, etc…
Each integration may (but does not have to) support different platforms that provide how these connect to home assistant and offer different configuration options. e.g. The Generic Camera platform is configured differently to MQTT Camera platform.
The lines get a bit blurred as there are cameras like Amcrest that are camera integrations, not camera platforms.
There is a list of integrations here:
It includes platforms as there is no real distinction made when looking to see if your device is supported. It may be a platform or it may be an integration. The docs for each will tell you which.