Time Stamp Class Sensor

If you have 6 different times, you’ll need 6 different sensors with the 90 minute offset. So the name:, unique_id: and the input 'sensor.islamic_prayer_times_midnight_time' in the template will all need to change. Also, you’ll need to add 1 trigger for each time trigger.

Yes, that’s my point. I will work on it and let you know.

guys, i just had a catastrophy… I accidently overwritten the configuration.yaml file.

my system is not starting at all… I have home assistant yellow by the way

any help, please!!

This is off topic @moderators can you split this in a topic of its own?

@WestWorld : did you make backups, and did you setup samba or another means for remote access to files?

The latest backup there was is a partial one dates back to 3 days ago… i also have an active account on Nabucasa, if this can help.

The backup may contain the configuration.yaml if you can get at it. If not, you could start with a relatively empty version to get running and then add in the things you need. If you broke out most sections and did not delete any other yaml files the damage shouldn’t be that bad. Question remains, did you set up the samba addon or any other means to access the files? What did you normally use to edit and/or how did you delete your configuration.yaml in the first place?

i did not set up samba addon.
the issue happened after i used the file editor addon to add a template. I saved the file as configuration.yaml
i think this caused to overwrite the original configuraiton.yaml file

can you still access the editor using:
<insert your ip here>:8123/hassio/ingress/core_configurator

i am getting this error message:
homeassistant.local refused to connect.

In that case I’d probably attach a monitor and keyboard to the yellow and try to do a safe boot useing the command line interface, or try to create a small configuration.yaml file from there.

I think i have an old backup file on my pc. Wouldn’t this work?

It is a compressed file, you can extract the contents using 7zip or similar to get at what is in it. But you’d have to find a way to get the file in the config directory. This thread may be of help as it is about how to use the cli to edit the configuration.yaml.

You could use it to put the basics in and reboot, and from there try to get it back to what is should be.

Would it be better to reset my home assistant yellow device and start over… then i might be able to restore the backup file.

what do you think?

That depends on how old the backup is. If it is just configuration.yaml and you can put it back, you lose nothing. If you restore the backup you’ll lose everything since the backup, provided it is indeed a working complete backup. If you cannot get the backup to work, you’re back to square one. You can always do that if getting configuration.yaml back does not work.

1 Like

it is a full backup file about 600 MB. it dates back to 4 or 5 months back.
i will check i first i can retrieve the configuration file as you advised earlier

Hi. Back to this subject.
the code here did work.

Thank you for your help

I’m still baffled as to why my code didn’t work for you… And now petro’s too? now I am wondering if you have the wrong time zone set for your home assistant… is that possible?

Is your time zone utc+3?

Because any time in the past minus now will be a negative timedelta.

Huh. I thought the sensor gave the next prayer time. So that it should never be time in the past. but then i admit I’m not familiar with the prayer time sensors.

Sorry I was thinking backwards, you had that part correct. The reason yours doesn’t work is that the result will have microseconds which means it won’t be equal to the left side of the equation.

1 Like