We have moved at community.getvera.com

Author Topic: Need assistance getting my openHAB environment working  (Read 9338 times)

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Need assistance getting my openHAB environment working
« on: January 26, 2015, 06:44:41 pm »
Hi guessed,

excuse me for the question, but I started to use OH on Raspberry with my Veralite (UI5) and I suppose there is some stupid error.

Following the log and the very simple item:

23:35:34.491 [DEBUG] [i.internal.GenericItemProvider:334  ] - Start processing binding configuration of Item 'Luci_Giardino (Type=SwitchItem, State=Uninitialized)' with 'MiosBindingProviderImpl' reader.
23:35:34.507 [DEBUG] [.b.m.i.MiosBindingProviderImpl:143  ] - processBindingConfiguration: Exception parsing/validating context 'DB_Home_VeraLite.items', item'Luci_Giardino (Type=SwitchItem, State=Uninitialized)', bindingConfig 'unit:DB_Home_VeraLite,device:4/service/SwitchPower1'.  Exception is Config for item 'Luci_Giardino' could not be parsed.  Bad general format 'unit:DB_Home_VeraLite,device:4/service/SwitchPower1'.
23:35:34.545 [ERROR] [i.internal.GenericItemProvider:343  ] - Binding configuration of type 'mios' of item ‘Luci_Giardino‘ could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: Config for item 'Luci_Giardino' could not be parsed.  Bad general format 'unit:DB_Home_VeraLite,device:4/service/SwitchPower1'


ITEM :

Group Rooms (All)
Group Garden "Garden" <Garden> (Rooms)
Group GSwitch "Switchs" (Rooms)
Switch   Luci_Giardino "Luci Giardino" (Garden,GSwitch) {mios="unit:DB_Home_VeraLite,device:4/service/SwitchPower1"}

tnks

donato

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #1 on: January 26, 2015, 06:58:35 pm »
donato,
You'll want to look at the last/3rd example from this Documentation link:
    https://github.com/openhab/openhab/wiki/MiOS-Binding#device-command-binding-examples-parameterless

From there, the example Light Switch Item declaration is:
Code: [Select]
Switch   FamilyTheatreLightsStatus "Family Theatre Lights" (GSwitch) {mios="unit:house,device:13/service/SwitchPower1/Status"}
and yours is:
Code: [Select]
Switch   Luci_Giardino "Luci Giardino" (Garden,GSwitch) {mios="unit:DB_Home_VeraLite,device:4/service/SwitchPower1"}

Putting them side-by-side, it looks like you're just missing the "/Status" part of the binding declaration, after the ServiceId Alias ("SwitchPower1")


Note also that the Unit name should also be Alpha-Numeric, per the comment at the bottom of this:
    https://github.com/openhab/openhab/wiki/MiOS-Binding#mios-unit-configuration

If I'm not enforcing it now, I may choose to do so down the line, so it'll be best to align it now.

eg. DBHomeVeraLite instead of DB_Home_VeraLite



Hope that helps, but if you have other issues feel free to attach the Items file and/or Sitemap file since it'll be easier for you to post those.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Need assistance getting my openHAB environment working
« Reply #2 on: January 27, 2015, 04:24:36 am »
Hi Guessed,

thank you very much for your support. Now it seems ok.

donato

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #3 on: January 27, 2015, 10:35:51 am »
Hi Guessed,

thank you very much for your support. Now it seems ok.

donato

Cool, glad you got it online!

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Need assistance getting my openHAB environment working
« Reply #4 on: January 27, 2015, 10:50:44 am »
Hi Guessed,

thank you very much for your support. Now it seems ok.

donato

Cool, glad you got it online!

Hi Guessed,

I linked a VeraEdge (UI7) controller too  where I've active a Thermostat and and Actuator. I'd like to change the setpoint temperaure but I can't get in OH. I only get the actual setpoint with no possibility to change.

Attached is the items file.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #5 on: January 27, 2015, 12:34:01 pm »
Here's the relevant openHAB Item definition [snippet] (from my OH/configurations/items/house.items) for my two [Nest] Thermostats:

Code: [Select]
Number   ThermostatUpstairsHeatCurrentSetpoint "Heat Setpoint [%.1f ?F]" <temperature> (GThermostatUpstairs) {mios="unit:house,device:335/service/TemperatureSetpoint1_Heat/CurrentSetpoint"}
Number   ThermostatDownstairsHeatCurrentSetpoint "Heat Setpoint [%.1f ?F]" <temperature> (GThermostatDownstairs) {mios="unit:house,device:384/service/TemperatureSetpoint1_Heat/CurrentSetpoint"}

and here's the relevant openHAB Sitemap definition [snippet] (from my OH/configurations/sitemaps/house.sitemap) that I use for Upstairs:
Code: [Select]
        Text     item=ThermostatUpstairsCurrentTemperature valuecolor=[ThermostatUpstairsModeState=="Cooling"="BLUE",ThermostatUpstairsModeState=="HeatOn"=="RED",NestHomeStatus==OFF="SILVER"] {
                Setpoint item=ThermostatUpstairsHeatCurrentSetpoint minValue=40 maxValue=80 valuecolor=[NestHomeStatus==OFF="SILVER"]
                Setpoint item=ThermostatUpstairsCoolCurrentSetpoint minValue=40 maxValue=80 valuecolor=[NestHomeStatus==OFF="SILVER"]
                Switch   item=ThermostatUpstairsModeStatus mappings=[HeatOn="Heat", CoolOn="Cool", AutoChangeOver="Auto", Off="Off"] valuecolor=[NestHomeStatus==OFF="SILVER"]
                Switch   item=ThermostatUpstairsFanMode mappings=[ContinuousOn="On", Auto="Auto"] valuecolor=[NestHomeStatus==OFF="SILVER"]
                Text     item=ThermostatHumidityUpstairsCurrentLevel valuecolor=[NestHomeStatus==OFF="SILVER"]
                Text     item=ThermostatUpstairsFanStatus valuecolor=[NestHomeStatus==OFF="SILVER"]
                Text     item=ThermostatUpstairsModeState valuecolor=[NestHomeStatus==OFF="SILVER"]
                Text     item=ThermostatUpstairsBatteryLevel valuecolor=[NestHomeStatus==OFF="SILVER"]
                Text     item=ThermostatUpstairsBatteryDate valuecolor=[NestHomeStatus==OFF="SILVER"]
        }

I ran this just now, using the openHAB "Classic" UI Client under Chrome, and could see that the changes I made in Chrome were reflected in the iPhone Nest application.

There are times though where the Chrome UI gets out of sync with openHAB.  The changes always get pushed through, but there appear to be times that the Chrome/Classic UI doesn't reflect changes in the underlying area.


One other thing to check is whether you've copied-forward the requisite openHAB MAP Transformation files, per this step in the Doc:
    https://github.com/openhab/openhab/wiki/MiOS-Binding#mios-transformations

If these are missing, then no commands will ever be sent down to MiOS/Vera, and there will be errors reported in OH/logs/openhab.log
« Last Edit: January 27, 2015, 09:12:43 pm by guessed »

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Need assistance getting my openHAB environment working
« Reply #6 on: January 27, 2015, 03:13:15 pm »
hi guessed,

I copied all the MAP transformation files.

To help  can you give me some more info on the link between your Sitemap definitions and the Items ?

tnks

donato

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #7 on: January 27, 2015, 09:26:12 pm »
hi guessed,

I copied all the MAP transformation files.

To help  can you give me some more info on the link between your Sitemap definitions and the Items ?

tnks

donato

I'm not sure what you're asking.

In my setup, I have a set of Items files and a set of SiteMap files.

The Items files include my MiOS-Derived stuff (eg. OH/configurations/items/house.items) and the Sitemaps include a page with ALL of my MiOS Items on it (eg. OH/configurations/sitemaps/house.sitemap)

The sitemap file is required for the clients (iOS, ClassicUI, etc) to render the Items, and to perform certain UI-only transformations.

The snippet from my previous post showed a small section of my Items file, relevant for the T-Stats, as well as the counterpart snippet of my Sitemap.  In both cases, these snippets need to be placed into a larger (complete) openHAB Items and/or Sitemap file.

For the Sitemap snippet, I put in some of the surrounding Items that I also derive from MiOS/Vera, you can trim these out if you don't have them in your environment (note: the names will be the ones that you chose, from your Items file, not the ones I've provided)

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Need assistance getting my openHAB environment working
« Reply #8 on: January 28, 2015, 04:20:18 pm »
hi guessed,

I'm working on your items generated with load.sh and transform.sh.

In particular I'm trying to change in OH the setpoint temperature of a thermostat . I've defined a setpoint and associated a MAP file (miosTStatSetpointHeatCommand). Attached is an hardcopy of UI.

When I try to change the setpoint I get the following msg :

2015-01-28 21:01:59.195 [WARN ] [b.m.internal.MiosUnitConnector] - invokeDevice: Command '11' not supported, or missing command: mapping, for Item 'TermostatoInternoSetpointTarget'

The item definition is :

String   TermostatoInternoSetpointTarget   "Termostato Interno FIXME SetpointTarget [%s]"   { mios="unit:DBHomeVeraEdge,device:6/service/urn:upnp-org:serviceId:TemperatureSetpoint1/SetpointTarget,command:MAP(miosTStatSetpointHeatCommand.map)" }


If I change the value from VeraEdge the value in OH UI changes correctly.

tnks donato

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #9 on: January 28, 2015, 07:21:48 pm »
You should try binding:
Quote
    {mios="unit:DBHomeVeraEdge,device:6/service/TemperatureSetpoint1_Heat/CurrentSetpoint"}
OR
    {mios="unit:DBHomeVeraEdge,device:6/service/urn:upnp-org:serviceId:TemperatureSetpoint1_Heat/CurrentSetpoint"}

instead of:
Quote
    {mios="unit:DBHomeVeraEdge,device:6/service/urn:upnp-org:serviceId:TemperatureSetpoint1/SetpointTarget,command:MAP(miosTStatSetpointHeatCommand.map)"}

I'm not sure where you definition came from, as the ones in the Documentation appear to be correct:
    https://github.com/openhab/openhab/wiki/MiOS-Binding#a-thermostat



This is what my [DEBUG] logs show through that same sequence, when initiated from an iPhone using the [aliased] green-highlighted definition above:

Code: [Select]
13:54:27.494 DEBUG o.o.i.r.i.r.ItemResource[:197]- Received HTTP POST request at 'items/ThermostatUpstairsHeatCurrentSetpoint' with value '52.0'.
13:54:27.498 DEBUG o.o.b.m.internal.MiosBinding[:252]- internalReceiveCommand: itemName 'ThermostatUpstairsHeatCurrentSetpoint', command '52.0'
13:54:27.501 DEBUG o.o.b.m.i.MiosUnitConnector[:175]- invokeDevice: Need to remote-invoke Device 'unit:house,device:335/service/urn:upnp-org:serviceId:TemperatureSetpoint1_Heat/CurrentSetpoint' action '52.0' and current state '52')
13:54:27.504 WARN  o.o.c.t.i.s.MapTransformationService[:70]- Could not find a mapping for '52.0' in the file 'miosTStatSetpointHeatCommand.map'.
13:54:27.505 DEBUG o.o.b.m.i.MiosUnitConnector[:200]- invokeDevice: decoded as serviceName 'urn:upnp-org:serviceId:TemperatureSetpoint1_Heat' serviceAction 'SetCurrentSetpoint' serviceParam 'NewCurrentSetpoint' serviceValue '??'
13:54:27.507 DEBUG o.o.b.m.i.MiosUnitConnector[:246]- callMios: Would like to fire off the URL 'http://192.168.1.xxx:3480/data_request?id=action&DeviceNum=335&serviceId=urn%3Aupnp-org%3AserviceId%3ATemperatureSetpoint1_Heat&action=SetCurrentSetpoint&NewCurrentSetpoint=52.0'

This is my Heat Setpoint definition:
Code: [Select]
Number   ThermostatUpstairsHeatCurrentSetpoint "Heat Setpoint [%.1f ?F]" <temperature> (GThermostatUpstairs) {mios="unit:house,device:335/service/TemperatureSetpoint1_Heat/CurrentSetpoint"}

So it'll pickup all the internal defaults for "command:" etc.


And here's the [standard] contents of my miosTStatSetpointHeatCommand.map file, just for reference:
Code: [Select]
    _defaultCommand=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat/SetCurrentSetpoint(NewCurrentSetpoint=??)

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Need assistance getting my openHAB environment working
« Reply #10 on: January 29, 2015, 08:40:31 am »
hi guessed,

it seems that the iphone app works correctly setting the setpoint temperature of thermostat while the web UI interface doesn't increment or decrement the value so the http command (correctly posted to unit) doesn't change the actual value.

Have you tried the web UI interface ?

I'm not sure but about the file ITEMS created by your tools it seems that in the row of a device relative to the status there is no device number . For example :

String   FoscamDBMotionSensorDeviceStatus "Foscam_DB Motion Sensor Device Status [%s]" (GDevice) {mios="unit:DBHomeVeraEdge,device:/status"}


tnks donato
 

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #11 on: January 29, 2015, 11:11:43 am »
it seems that the iphone app works correctly setting the setpoint temperature of thermostat while the web UI interface doesn't increment or decrement the value so the http command (correctly posted to unit) doesn't change the actual value.

Have you tried the web UI interface ?

Under Chrome, yes.  I tried it with both the Chrome/Desktop UI as well as under iOS Native app and both made the changes correctly in Vera (and, in my case, the underlying Nest Thermostat driven by @watou's Nest Plugin handywork)

Quote
I'm not sure but about the file ITEMS created by your tools it seems that in the row of a device relative to the status there is no device number . For example :

String   FoscamDBMotionSensorDeviceStatus "Foscam_DB Motion Sensor Device Status [%s]" (GDevice) {mios="unit:DBHomeVeraEdge,device:/status"}

Yup, that was a bug.  I was printing the status value, instead of the ID value when generating that particular string.   I've patched the file, and re-pushed it to Box.net so it'll generate correctly next time.

Note that there are still likely issues in the generator, so it will need to be double checked before using it wholesale.


Thanks for the catch!

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Need assistance getting my openHAB environment working
« Reply #12 on: January 30, 2015, 05:24:08 pm »
Hi guessed,

I'm trying to get the Power Usage (Watt) from a Fibaro Wall Plug and graph the value (I've activate rrd4j persistence). I'd like to get average value every 5 seconds (in a second phase I'd like to integrate a Current Cost monitor) : have you any experience o idea in this area ?

thank you

donato 

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #13 on: January 30, 2015, 07:09:21 pm »
Hi guessed,

I'm trying to get the Power Usage (Watt) from a Fibaro Wall Plug and graph the value (I've activate rrd4j persistence). I'd like to get average value every 5 seconds (in a second phase I'd like to integrate a Current Cost monitor) : have you any experience o idea in this area ?

thank you

donato

I've not re-enabled my Energy Monitoring in Vera (it can't handle the traffic) but I adapted the Demo (Weather) openHAB Graphs/Charts for Temperature (Upstairs/Downstairs/Outside/Garage)

If you've got the original openHAB Demo Item/SiteMap files, it's trivial to adapt them to other use-cases.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Need assistance getting my openHAB environment working
« Reply #14 on: January 30, 2015, 07:18:02 pm »
For reference, here are the Demo Items & Sitemap files:
    https://github.com/openhab/openhab/blob/master/distribution/openhabhome/configurations/items/demo.items
    https://github.com/openhab/openhab/blob/master/distribution/openhabhome/configurations/sitemaps/demo.sitemap


Notes:
1) Weather_Chart_Period is an unbound Item acting as the /Hour/Day/Week "selector" for the Chart.
2) Weather_Chart is a Group containing all the Items to be Graphed.