New User, need simple code to prove my PI is working

Hi, just installed Home Assistant on my PI. I have set up SAMBA and can get to the home page but I cant seem to get it to do anything.

At present I have no devices, I have signed up for Pushbullet and have an Amazon Dot

I have tried setting a time event to send me a message, but cant get it to work. Bit confused about the correct use if the Device Tags.

Any know working script that I can enter into my config file to test my PI. Just to show an Icon on the screen or play a audio file.

I am old school still writing code in assembler for Micro’s that I use.

Regards, Dave

First off welcome.

Post your config for the message and we can work from there. See below for how to post your config and preserve the formatting. YAML is very sensitive to formatting so it helps to post is properly so the users here can check it.

HA doesn’t really do much until you start adding components and sensors and writing automation to work with those components and sensors. Its extremely powerful once you get rolling but the first steps can be hard. Lets get your messaging example working and you can see how it all works.

Thanks for the reply I have typed in this to send an email at a certain time

automation:
  - alias: Send message at a given time
    trigger:
      platform: time
      hours: 16
      minutes: 35
      seconds: 00
    action:
      service: NOTIFIER_NAME
    data:
        message: Test Email


   
   
notify:
  - name: NOTIFIER_NAME
    platform: smtp
    server: smtp.xxxxxxxxxxxxx.co.uk
    username: [email protected]
    password: xxxxxxxxxx
    recipient: [email protected]

I get an error on the HA States Page.

Invalid config, the following components and platforms could not be set up

automation

Ok, not sure if your notify competent is setup correctly as alot of it is missing (for obvious reasons) but the below config for your automation should work.

automation:
  - alias: Send message at a given time
    trigger:
      platform: time
      after: '16:35:00'
    action:
      service: notify.notifier_name
      data:
        message: Test Email

Two fixes. The time trigger was the incorrect version. The version you uses tries to match the time every hour so the hour:16 cannot be used. The time triggers are documented here:

Second was just some alignment of the data: item. It needed to be in line with the service item.

Hi, tried the code, but no email.

Not sure if its the timer code or email code.

Is there anything else I could get the timer to do? or can I manually trigger the email code?

Thanks, Dave

Yes it can be tested in the services tab. I don’t recall the formatting though for adding the message. Its in JSON and Im not very good at getting that right. Ill try tonight to get a working sample if no one chimes in sooner.

Service data for your notify service:
{“message”:“This is a test”}

Thank you both, my code is working.

It was my notify that was not working, set up a new notify using gmail and that works.

Do you always have to restart for the code to work or should the changes take effect with the reload_core_config service.

Re Happy Dave