Page 1 of 1

How do I put my virtual weather devices in the weather tab?

Posted: Tuesday 22 December 2020 9:48
by Sarcas
I made my own DzVents script to get weather info and forecasts from OpenWeathermap. It is current weather, temperature and descriptions like ‘cloudy’, and I choose forecast periods of 3, 6 and 9 hours. I can find the temperature devices in the Temperature-tab, but the weather tab would make more sense. The text prediction are under ‘Utility’. How can I move the devices to the correct tab?

Thx

Re: How do I put my virtual weather devices in the weather tab?

Posted: Tuesday 22 December 2020 10:16
by waaren
Sarcas wrote: Tuesday 22 December 2020 9:48 How can I move the devices to the correct tab?
You can't.
The tab where devices are shown is hardcoded based on the devicetypes.

Re: How do I put my virtual weather devices in the weather tab?

Posted: Wednesday 23 December 2020 6:58
by kiddigital
Sarcas wrote:I made my own DzVents script to get weather info and forecasts from OpenWeathermap. It is current weather, temperature and descriptions like ‘cloudy’, and I choose forecast periods of 3, 6 and 9 hours...

Thx
Just curious, which version are you running? Did you try the updated OWM module in the Beta? Wondering what your use-case is that might not be covered by the updated module Image

Re: How do I put my virtual weather devices in the weather tab?

Posted: Wednesday 23 December 2020 7:50
by Sarcas
I made the script before the updated OWM module. I did not know it was updated actually. I am running the latest beta. I believe my main reason for making my own script was that I wanted forecasts for several hours.

I'll take a look at the module, thanks for the tip!

Re: How do I put my virtual weather devices in the weather tab?

Posted: Wednesday 23 December 2020 8:25
by Sarcas
The new module look pretty good. Easy to set up :)

My script just used the sensors I needed at that time, but the new module got them all. Nice. I’ll see if I can make a script to clean it up a bit though. I don’t like ‘Hour 1’ or ‘Day 1’ and in my script I change the device names to like “Precipitation at 16:00h” or “Feel temp tomorrow (Thursday)”.
dash.png
dash.png (201.89 KiB) Viewed 960 times

Re: How do I put my virtual weather devices in the weather tab?

Posted: Wednesday 23 December 2020 8:32
by kiddigital
Glad it works for you.

About the device names, as the predictions ‘move’ over time, hour 1 is a different hour every hour. It points the the 1 hour after the current hour.

Do you constantly update the devicenames in your script? So they keep changing?

Re: How do I put my virtual weather devices in the weather tab?

Posted: Tuesday 05 July 2022 16:47
by Sarcas
Sorry, I somehow missed the question... So with a bit of a delay: yes, the script changes the names of the virtual devices every hour.

Something like this:

Code: Select all

		forecast_temp_6h_deviceName 	= 'Temperatuur om ' .. os.date("%H", OWMMain.hourly[6].dt) .. ':' .. os.date("%M", OWMMain.hourly[6].dt) .. ' uur:'
		newName 			= domoticz.utils.urlEncode(forecast_temp_6h_deviceName)
		url				= domoticz.settings.url .. "/json.htm?type=command&param=renamedevice&idx=" .. idx_forecast_temp_6h .. "&name="  .. newName
		domoticz.openURL(url)