I was wondering if there is anybody who knows if it’s possible to set up a temple sensor or a scripts that could translate the summary data from DarkSky. I think this could maybe be done with some kind of HTTP request to Google translate, but I have no idea how to implement it.
Now I just need to figure out how to somehow implement this in a script that takes the state of a sensor, puts it into the url and writes the reply to another sensor.
It seems pretty simple, but so is my coding skills or lack thereof.
This is as far as I’ve gotten. It works if you hardcode the text but doesn’t seem to fetch a variable from another sensor. Maybe someone else has ideas.
Great work man, I was messing around with the idea of a rest sensor myself - not getting very fare though.
I don’t think that HA can handle a entity within a entity like that? … However It might work if we had a local json file that a script wrote the output of the dark sky sensor to, every x minutes? the rest sensor could then perhaps read the output from the local json file and serve the translation that way?
It’s one of those things where I can think it, but have a hard time coding it so it’s great to se someone else jumping in as well.
Yeah I was hoping it would. I’ve used a sensor variable inside a camera URL before and also a sensor on a sensor so I was hopeful this would work. It may need a tweak to the component. I might try my hand at that. There’s got to be a way to make this happen. I’ll keep trying on my end. Let me know if you come up with anything
Very interesting, I have never had a use for it (before now) but great to know that it works with some components.
Sounds great, I’ll try my hand on some shell scripting in the meantime.
I agree, this can’t be that hard to get working, and I think that automatic translation should have a great potential with how international this community is. I was honestly a bit surprised that I could not find anybody that had already done something similar.
Finaly a little progress here. I got a working “translate word from file sensor going” - due to a lot of weird syntax errors in bash this is done with two bash scripts and a sensor
First the sensor: (scan interval is very low due to testing)
link.sh then just holds the curl link that the sensor is using. I would have liked to have ts.sh just give the link, but it gave all kinds of weird errors and after spending most of today trying to solve it I gave up.
Next step is the first step - actually getting text into ts.txt, hopefully I can get that figures out soon.