Burh multisensor with mqtt

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage PI3
    • OS: what OS is used and which version
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version:2
  • Issue of the topic: please be detailed explaining your issue
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

Hi
i am facing problem with bruah Mqtt multi sensor setup in openhab2
i am sucessfully getting mqtt out out
> pi@raspberrypi:/etc/openhab2/items $ mosquitto_sub -h localhost -t bruh/sensornode1 -v
> bruh/sensornode1 {“state”:“OFF”,“color”:{“r”:255,“g”:255,“b”:255},“brightness”:255,“humidity”:“55.50”,“motion”:“standby”,“ldr”:“265”,“temperature”:“80.78”,“heatIndex”:“82.18”}

but un able to display in openahab basic UI
below is items mqtt code
Number temperature2 “Temperature [%.1f°C]” {mqtt="<[broker:bruh/sensornode1:state:JSONPATH($.temperature)]"}
Number temperature3 “Real feel Temperature [%.1f°C]” {mqtt="<[broker:bruh/sensornode1:state:JSONPATH($.heatIndex)]"}

and below is sitemap
sitemap Home label=“MyHome”
{
Frame {
Text item=temperature2
Text item=temperature3

    }

}

below is error log

2018-03-01 13:42:59.761 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
2018-03-01 13:42:59.764 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn’t post update for ‘temperature3’

2018-03-01 13:55:27.560 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
2018-03-01 13:55:27.564 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn’t post update for ‘temperature2’


https://github.com/bruhautomation/ESP-MQTT-JSON-Multisensor/blob/master/example_home_assistant_configuration.yaml

above is bruh mqtt multi sensor
any body help me whats wrong

Starting with the first error.
-Install the JSONPATH Transformation Service via PaperUI!

Hi
thanks for help now few thing confusion about mqtt and sitemap becuase i am new i used to do work on Home assistant
Number LDR “LDR [%.1f%%]” {mqtt="<[broker:bruh/sensornode1:state:JSONPATH($.ldr)]"}
how to print this currently its printer as Number

and how to do below mqtt in item and site map
platform: mqtt_json
name: "SN1 LED"
state_topic: "bruh/sensornode1"
command_topic: "bruh/sensornode1/set"
brightness: true
flash: true
rgb: true
optimistic: false
qos: 0
what i have to use for show rgb selection in site map as well in items

In order to Show the number item “LDR” on your sitemap just use:

Text item=LDR

Sorry, can’t help on the second question (new to that as well)

https://docs.openhab.org/configuration/sitemaps.html#element-type-colorpicker

Hi
thanks for reply ,can you confirm how i read this mqtt for light
light:

  • platform: mqtt_json
    name: "SN1 LED"
    state_topic: "bruh/sensornode1"
    command_topic: "bruh/sensornode1/set"
    brightness: true
    flash: true
    rgb: true
    optimistic: false
    qos: 0

please if possible write item code for this rgb.
thanks

I have everything on the multisensor working through Openhab except for the LED. Anyone have an example for changing color, or have the native MQTT cmnd to change it manually from MQTT client?
Thanks!

Hi,
The led was pretty hard!

Example of payload: {“state”:“ON”,“color”:{“r”:255,“g”:255,“b”:255}}
remember to publish to your set topic (default: bruh/sensornode1/set)

You can also pass: transition(int) and flash(int)

So I have these items:

String Motion 	{mqtt="<[broker:bruh/sensornode1:state:JSONPATH($.motion):.*]"}
String SensornodeSet {mqtt=">[broker:bruh/sensornode1/set:command:*:default]"}

and rules to publish to that SensornodeSet topic

rule "alarmSetRedlight"
when
   Item Motion changed from standby to "motion detected"
then
  SensornodeSet.sendCommand("{\"state\":\"ON\",\"color\":{\"r\":255,\"g\":0,\"b\":0}}")
end

rule "alarmNolight"
when
   Item Motion changed from "motion detected" to standby
then
    SensornodeSet .sendCommand("{\"state\":\"OFF\",\"color\":{\"r\":0,\"g\":0,\"b\":0}}")
end