Hi
I downloaded OH today on a Pi3 with a bespoke MQTT client from here: https://github.com/gpbenton/engMQTTClient
Using the homebuilder and ‘standard’ PaperUI I have successfully setup an Energenie eTRV using the MQTT addon and an MQTT Broker thing.
I can read/set TRV with ID 8008. Ive wound back the config a bit and now I;m stuck,
What I want to do is create a single “generic/template” thing for an Energenie eTRV and “instantiate” this for the 11 TRV physical devices in my home. I want to avoid having to duplicate all the effort to set up 11 TRVs when in fact I want all the same command and report topics (ref. that GitHub link above) - where the only aspect that will change is the eTRV ID. So somehow I’d need to pass the ID of the TRV , somehow.
MQTT Commands tree at /energenie/eTRV/Command/(command-as-below)/(device-id)
Command | Payload | Comment |
---|---|---|
Temperature | 4-30 (Ascii) | Set Target Temperature |
Identify | None | Makes the MIH0013 flash |
Exercise | None | Causes Valve to go up and down. Creates Diagnostic when finished. |
Voltage | None | MIH0013 reports battery Voltage |
Diagnostics | None | Causes MIH0013 to report diagnostics |
ValveState | “0”, “1” or “2” (ascii) | 0=Set Valve Open 1=Closed 2=Normal Operation |
PowerMode | “0”, “1” | 0=Low Power Mode off 1=On |
ReportingInterval | 300-3600 (ascii) | Set the Reporting Interval (not tested) |
MQTT States tree at /energenie/eTRV/Report/(report-command-as-below)/(device-id):
Report | Payload | Comment |
---|---|---|
Temperature | Ascii string | Measured Temperature in degrees Centigrade |
TargetTemperature | Ascii String | Target Temperature set |
Diagnostics | 2 bytes | byte 0 = low byte, 1 = high byte |
Voltage | Ascii String | Reported Battery Voltage |
So in other words, I want to define a single thing in OH for a “template/generic” TRV , with (if possible)
one set of topics I want to publish/subscribe to, and the channels; and finally based on this , I want to create the 11 items to represent the physical TRVs in the home. I might need to rework how I do this but you get the idea?
It seems a huge overkill to have to create all the same for all 11 TRvs where the only parameter will be the ID of the TRV I want to set/read. So Is it possible , and how.?
All I have is an items and sitemap file so I’ve posted these below:
p.s. I am a total newbie at this so please explain the solution - Ive read OH documents on Things and MQTT but clearly not capable of getting further with this,
My items file:
Group Home "Keats" <house> ["Building"]
Group OU "Outside" <garden> (Home) ["Outdoor"]
Group GF "Ground Floor" <groundfloor> (Home) ["GroundFloor"]
Group FF "First Floor" <firstfloor> (Home) ["FirstFloor"]
Group F2 "Second Floor" <attic> (Home) ["Attic"]
Group OU_Garden "Garden" <none> (Home, OU)
Group OU_Garage "Garage" <garage> (Home, OU) ["Garage"]
Group OU_Driveway "Driveway" (Home, OU) ["Outdoor"]
Group GF_Porch "Porch" <group> (Home, GF) ["Outside"]
Group GF_Toilet "Toilet" <toilet> (Home, GF) ["Bathroom"]
Group GF_Garage "Garage" <garage> (Home, GF) ["Garage"]
Group GF_Kitchen "Kitchen" <kitchen> (Home, GF) ["Kitchen"]
Group FF_Lounge "Lounge" <sofa> (Home, FF) ["Room"]
Group FF_Bedroom "Bedroom" <bedroom> (Home, FF) ["Bedroom"]
Group F2_Wardrobe "Wardrobe" <wardrobe> (Home, F2)
Group F2_BedroomSummer "Bedroom-Summer" <none> (Home, F2)
Group F2_BedroomSpare "Bedroom-Spare" <none> (Home, F2)
Group F2_Toilet "Toilet" <toilet> (Home, F2) ["Bathroom"]
Switch OU_Garage_UpAndOverDoor "Up-and-Over-Door" <none> (OU_Garage, gUpAndOverDoor) {channel=""}
Switch GF_Porch_Motion "Motion Sensor" <motion> (GF_Porch, gMotion) ["MotionDetector", "Switchable"] {channel=""}
Switch GF_Porch_Light "Light" <light> (GF_Porch, gLight) ["Lighting", "Switchable"] {channel=""}
Contact GF_Toilet_Window "Window" <window> (GF_Toilet, gWindow) ["Window"] {channel=""}
Contact GF_Garage_Door "Door" <door> (GF_Garage, gDoor) ["Door"] {channel=""}
Switch GF_Garage_Motion "Motion Sensor" <motion> (GF_Garage, gMotion) ["MotionDetector", "Switchable"] {channel=""}
Switch GF_Kitchen_Fan "Fan" <fan_ceiling> (GF_Kitchen, gFan) ["Switchable"] {channel=""}
Contact GF_Kitchen_Door "Door" <door> (GF_Kitchen, gDoor) ["Door"] {channel=""}
Contact GF_Kitchen_Window "Window" <window> (GF_Kitchen, gWindow) ["Window"] {channel=""}
Number GF_Kitchen_Heating "Heating" <heating> (GF_Kitchen, gHeating) ["HVAC"] {channel=""}
Switch GF_Kitchen_Motion "Motion Sensor" <motion> (GF_Kitchen, gMotion) ["MotionDetector", "Switchable"] {channel=""}
Contact FF_Lounge_Window "Window" <window> (FF_Lounge, gWindow) ["Window"] {channel=""}
Number FF_Lounge_Temperature "Temperature" <temperature> (FF_Lounge, gTemperature) ["Temperature"] {channel=""}
Switch FF_Lounge_Light "Light" <light> (FF_Lounge, gLight) ["Lighting", "Switchable"] {channel=""}
Switch FF_Bedroom_Motion "Motion Sensor" <motion> (FF_Bedroom, gMotion) ["MotionDetector", "Switchable"] {channel=""}
Number FF_Bedroom_Temperature "Temperature" <temperature> (FF_Bedroom, gTemperature) ["Temperature"] {channel=""}
Switch FF_Bedroom_Light "Light" <light> (FF_Bedroom, gLight) ["Lighting", "Switchable"] {channel=""}
Contact FF_Bedroom_Window "Window" <window> (FF_Bedroom, gWindow) ["Window"] {channel=""}
Contact FF_Bedroom_Door "Door" <door> (FF_Bedroom, gDoor) ["Door"] {channel=""}
Contact F2_Wardrobe_Window "Window" <window> (F2_Wardrobe, gWindow) ["Window"] {channel=""}
Number F2_BedroomSummer_Temperature "Temperature" <temperature> (F2_BedroomSummer, gTemperature) ["Temperature"] {channel=""}
Switch F2_BedroomSummer_Light "Light" <light> (F2_BedroomSummer, gLight) ["Lighting", "Switchable"] {channel=""}
Contact F2_BedroomSummer_Window "Window" <window> (F2_BedroomSummer, gWindow) ["Window"] {channel=""}
Contact F2_BedroomSpare_Window "Window" <window> (F2_BedroomSpare, gWindow) ["Window"] {channel=""}
Group:Switch:OR(ON, OFF) gFan "Fan" <fan_ceiling> (Home) ["Switchable"]
Group:Contact:OR(OPEN, CLOSED) gDoor "Door" <door> (Home) ["Door"]
Group:Contact:OR(OPEN, CLOSED) gWindow "Window" <window> (Home) ["Window"]
Group:Number:AVG gHeating "Heating" <heating> (Home) ["HVAC"]
Group:Switch:OR(ON, OFF) gMotion "Motion Sensor" <motion> (Home) ["MotionDetector", "Switchable"]
Group:Switch:OR(ON, OFF) gLight "Light" <light> (Home) ["Lighting", "Switchable"]
Group:Switch:OR(ON, OFF) gUpAndOverDoor "Up-and-Over-Door" <none> (Home)
Group:Number:AVG gTemperature "Temperature" <temperature> (Home) ["Temperature"]
My sitemap file:
sitemap keats label="Keats" {
Frame label="Outside" icon="garden" {
Group item=OU_Garden
Group item=OU_Garage
Group item=OU_Driveway
}
Frame label="Ground Floor" icon="groundfloor" {
Group item=GF_Porch
Group item=GF_Toilet
Group item=GF_Garage
Group item=GF_Kitchen
}
Frame label="First Floor" icon="firstfloor" {
Group item=FF_Lounge
Group item=FF_Bedroom
}
Frame label="Second Floor" icon="attic" {
Group item=F2_Wardrobe
Group item=F2_BedroomSummer
Group item=F2_BedroomSpare
Group item=F2_Toilet
}
Frame {
Text label="Fan" icon="fan_ceiling" {
Default item=GF_Kitchen_Fan label="Kitchen"
}
Text label="Door" icon="door" {
Default item=GF_Garage_Door label="Garage"
Default item=GF_Kitchen_Door label="Kitchen"
Default item=FF_Bedroom_Door label="Bedroom"
}
Text label="Window" icon="window" {
Default item=GF_Toilet_Window label="Toilet"
Default item=GF_Kitchen_Window label="Kitchen"
Default item=FF_Lounge_Window label="Lounge"
Default item=FF_Bedroom_Window label="Bedroom"
Default item=F2_Wardrobe_Window label="Wardrobe"
Default item=F2_BedroomSummer_Window label="Bedroom-Summer"
Default item=F2_BedroomSpare_Window label="Bedroom-Spare"
}
Text label="Heating" icon="heating" {
Default item=GF_Kitchen_Heating label="Kitchen"
}
Text label="Motion Sensor" icon="motion" {
Default item=GF_Porch_Motion label="Porch"
Default item=GF_Garage_Motion label="Garage"
Default item=GF_Kitchen_Motion label="Kitchen"
Default item=FF_Bedroom_Motion label="Bedroom"
}
Text label="Light" icon="light" {
Default item=GF_Porch_Light label="Porch"
Default item=FF_Lounge_Light label="Lounge"
Default item=FF_Bedroom_Light label="Bedroom"
Default item=F2_BedroomSummer_Light label="Bedroom-Summer"
}
Text label="Up-and-Over-Door" {
Default item=OU_Garage_UpAndOverDoor label="Garage"
}
Text label="Temperature" icon="temperature" {
Default item=FF_Lounge_Temperature label="Lounge"
Default item=FF_Bedroom_Temperature label="Bedroom"
Default item=F2_BedroomSummer_Temperature label="Bedroom-Summer"
}
}
}