Hi,
I’m trying to integrate the local waste collection schedule into HA.
Found an API with all the dates, unfortunately, HA complains it’s too big (+255 chars) to import & template.
But with the help of Apify I managed to make the API response a lot smaller.
(Date fields are milisecond epoch)
But I still can’t manage to get it into HA…
Anyone able to help?
Sample API response:
[{
"Umido": "1539820800000",
"Secco": "1540166400000",
"Carta": "1539648000000",
"Plastica": "1540339200000",
"Vetro": "1539907200000",
"Ecomobile": "1541462400000",
"url": "http://www.convenzionerifiutisesto.it/RaccolteDomicilio/LoadRaccolteDomicilioForComune?comuneId=30"
}]
Configuration Snippets:
Try 1:
- platform: rest
name: Umido Collection
resource: https://api.apify.com/v1/wRi29ffoih2SPhwMA/crawlers/BC24cHRsNwCSM2epA/lastExec/results?simplified=1&token=worJhZpKAnHKCKv27dBsgkP5N
value_template: '{{ (value_json.Umido | float / 1000) | timestamp_local }}'
Try 2:
- platform: rest
resource: https://api.apify.com/v1/wRi29ffoih2SPhwMA/crawlers/BC24cHRsNwCSM2epA/lastExec/results?simplified=1&token=worJhZpKAnHKCKv27dBsgkP5N
name: Waste Collection
json_attributes:
- Umido
Error log:
2018-10-15 15:32:59 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'list object' has no attribute 'Umido' (value: [{
"Umido": "1539820800000",
"Secco": "1540166400000",
"Carta": "1539648000000",
"Plastica": "1540339200000",
"Vetro": "1539907200000",
"Ecomobile": "1541462400000",
"url": "http://www.convenzionerifiutisesto.it/RaccolteDomicilio/LoadRaccolteDomicilioForComune?comuneId=30"
}], template: {{ (value_json.Umido | float / 1000) | timestamp_local }})