New in HA: Invalid config for [sensor]: required key not provided @ data['platform']. Got None

I am new in HA & not a programmer at all :slight_smile:

I am trying to add an HTTP temperature sensor

I received from the vendor this to add to configuration.yaml, but it does not work:

dorest: - resource: http://192.168.1.67/temp/
scan_interval: 30
sensor: - name: obyvak_teplomer
unique_id: "TEMP1"
value_template: "{{ value_json.temp }}"
device_class: temperature
unit_of_measurement: "C"

I realized I need to create sensor.yaml file and direct there, so I have:

configuration.yaml:

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

sensor: !include sensor.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml    

and sensor.yaml:

dorest: - resource: http://192.168.0.3/temp/

scan_interval: 30

  - sensor:
    - name: "Bazen_voda"
      unique_id: "TEMP1"
      value_template: "{{ value_json.temp }}"
      device_class: temperature
      unit_of_measurement: "C"       

But I am getting “Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None.” error.

How is it correct?

How to Help us Help You: Format it Properly

thanks @Didgeridrew

Unfortunately what they gave you is … suspect to say the least. There’s no “dorest” platform. I guess they were aiming for a restful sensor, but if so they missed it by quite a lot.

All of that is wrong… where did you get it from?

from the very local vendor manufacturing wifi thermometres…

Long story short - after many years of using z-wave VeraPlus I cannot find a reliable thermometer for a swimming pool. This guy is manufacturing them and has this manual to add the thermometer to HA…

How should it be correctly written?

I have no idea what it’s trying to do.

If it’s the rest integration, it shouldn’t even be inside sensor.yaml. It should be in configuration.yaml.

And what is dorest???

I guess, it is supposed to link HA to the sensor’s url, but I do not understand the correct syntax of how it should be done…

Where did you get the syntax from? It seems like you just made it up. We need to understand what it’s doing so that we can help you. Post where you got it from, with details on how you came up with it.

Home Assistent návod (brrr.cz)

image

Please observe the images in that resource. It has the proper syntax, placement, and spacing.

1 Like

I see: in the manual text is “dorest” and in the picture is “rest” - it works now!

Thanks a lot!

1 Like