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