Is it possible to get sunrise/sunset times from Domoticz within a python plugin?
Or the user variables?
python plugin: sunset/sunrise times
Moderator: leecollings
-
- Posts: 96
- Joined: Thursday 18 May 2017 8:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Left
- Contact:
Re: python plugin: sunset/sunrise times
I hope there are some better option to implment it by my own. There are examples how to do it:
http://thorpesoftware.com/calculating-s ... nd-sunset/
https://www.raspberrypi.org/forums/view ... 2&t=114745
It's like reinventing hte wheel
http://thorpesoftware.com/calculating-s ... nd-sunset/
https://www.raspberrypi.org/forums/view ... 2&t=114745
It's like reinventing hte wheel

-
- Posts: 96
- Joined: Thursday 18 May 2017 8:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Left
- Contact:
Re: python plugin: sunset/sunrise times
Yes its possible, I thought of it. But is doesn't make sense to call the domoticz API from a plugin.Hesmink wrote:How about using: https://www.domoticz.com/wiki/Domoticz_ ... nset_times
I assume it is available within the plugin context since all settings also can be retrieved.
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: python plugin: sunset/sunrise times
Did anyone find a solution for this so to obtain sunrise and sunset from within a plugin ?elgringo wrote: ↑Wednesday 31 May 2017 11:45Yes its possible, I thought of it. But is doesn't make sense to call the domoticz API from a plugin.Hesmink wrote:How about using: https://www.domoticz.com/wiki/Domoticz_ ... nset_times
I assume it is available within the plugin context since all settings also can be retrieved.
I found something like this.
Code: Select all
cmd = '/json.htm?type=command¶m=getSunRiseSet'
dJson = self.request(self.url(cmd))
Domoticz.Debug("result:" + str(dJson))

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Who is online
Users browsing this forum: No registered users and 1 guest