So, how best to specify subscribed topics?
I don't want to get into a complicated subscription management system, at least not at first. But I was thinking about a couple of actions - one to add a subscription to a broker, another to remove one.
{
"deviceId": 12345,
"deviceType":, "OUTLET|LIGHT|DIMMER|OTHER",
"deviceValue":, "ON|OFF|0|25|50|75|100"
}
{
targetId,
targetClass,
targetType,
targetValue
}
data -> deviceId
data -> deviceValue
x -> y -> z.
/homeautomation
/deviceUpdate
/executeAction
/setVariableValue
/environment
/irrigation
/sensor
/reportSensorValue
/weather
/reportAirQuality
/reportAltitude
/reportBarometricPressure
/reportHumidity
/reportLightningDetected
/reportLux
/reportTemperatureInside
/reportTemperatureOutside
/reportPrecipitation
/reportWindSpeed
/reportWindDirection
/media
/playMediaItem
/mediaItemPlaying
/geolocation
/reportItemLocation
{
"deviceId": 12345,
"deviceType": "OUTLET|LIGHT|DIMMER|OTHER",
"deviceValue": "ON|OFF|0|25|50|75|100"
}
import json
input = '{"deviceValue": "ON", "deviceType": "OUTLET", "deviceId": 12345}'.
data = json.loads(input)
device = indigo.devices[data["deviceId"]]
type = data["deviceType"]
value = data["deviceValue"]
FlyingDiver wrote:Jay - I am correct in thinking that any random plugin cannot modify state for another plugin's devices, right?
jay (support) wrote:We intentionally prevent external write access to device states/properties/configs which would present both a security risk and the possibility that the device would become inoperative based on another plugin/script manipulating it's states...
input = '{"deviceValue": "ON", "deviceType": "OUTLET", "deviceId": 12345}'.
data = json.loads(input)
device = indigo.devices[data["deviceId"]]
type = data["deviceType"]
value = data["deviceValue"]
// psuedo code:
http.get('localhost:8176/devices/' + urlEncode(device.name) + '.json?isOn=' + urlEncode(value) + '&_method=put')
mreyn2005 wrote:Is calling the local REST web API an option from within the python script?
Users browsing this forum: No registered users and 2 guests