Reading and saving data: suggestions needed

I have a couple of questions regarding reading and writing external data and using this in AD.

  1. The first project is a status update on waste collection. We have a very elaborate waste collecting scheme* that can be confusing. I have the data in a PDF and could transfer it to a CSV, TXT or other file or just put it in a database or something. But as a starting AD enthousiast I have no idea what solution would fit best. There are about 120 pickups every year so that’s not an awful lot of data. What would you suggest?
  2. A second project is about retaining data in between reboots of HA. For some appliances in my home (washing machine, dryer etc.) I keep track of their power usage and want HA/AD to calculate the cost of use for single uses, per day, per month, per year etc. What would you suggest? I’ve considered creating a sensor or something like that in HA and update it through AD, but also writing values to a file or a database directly. I’d like to know what solution you would use!

Thanks in advance!

*Luckily our local government is encouraging recycling and separated waste collection, but this results in an elaborate schedule. Food and garden waste, plastics, paper, cans and glass, and “rest waste” are collected separately, some every two weeks, others every four weeks. Some on mondays, some on wednesdays and also there are extra seasonal pickups like pruning waste in spring and leaves in autumn. It’s really really great, but the scheme takes quite an effort to keep track off.

You can use any method that python supports :slight_smile: I would probably go with a CSV file, although in the next AppDaemon beta you will be able to add arbitrarily complex dictionaries as parameters to apps so you could just stick it in the config file at that point.

I solved a similar problem using shelve to store data to disk. For an example check out switch_reset.py in the conf/example_apps directory.

1 Like

Can you import the data into a format that Google Calendar can read. Then you can use the Google Calendar component to create triggers.

My council publishes the bin collection days to an ics file. Currently, I just include this in my phone calendar, but if I needed some kind of automation I would probably import the ics file into a google calendar.

i second that.

i have a seperate calender running for a few years now for my wife.
i just did put the data in excel and exported it to csv.
that is imported in google calender.
only recently i implemented google calender in HA and now i can use notifies and spoken text to alert my wife.

yeah, i am modern, i dont take the trash out, she does :stuck_out_tongue:

Thx @gpbenton and @ReneTode for the feedback, it shows once again how valuable sharing can be :slight_smile: I started this project with the idea of scraping the data from a website and because of that I was thinking along the lines of AppDaemon (the Scraper component couldn’t do the job). Since then I dropped the scraping idea because it’s too much work for too little data, but I never thought about other ways to fix this with, for instance, the calendar component. I will definitely try this!

And @ReneTode, “modern” is sharing the load, not taking over everything :wink: I just rather do the trash than the toilet, that’s our deal :stuck_out_tongue:

1 Like

i rather cook and make the trash :stuck_out_tongue:

i just thought about it, because on TV in series or sitcoms i see lots of times coming by that taking the trash out is the mans job.
in my mind there is no job connected to a gender, except being pregnant :wink:

1 Like