Hop til indhold
  • 0

Værdi fra mqtt over til IHC


BrianPedersen
 Share

Spørgsmål

Er der nogle der har erfaringer med at hente en værdi fra MQTT og putte den over i IHC..? jeg har noget hjemmebygget temperatur og fugtmåler, baseret på tasmota firmware, som leverer temperatur og luftfugtighed til openhab via MQTT

Jeg har fundet denne, fra guiden til IHC bindingen, som jeg skal have omskrevet, til at hente værdien fra mqtt (en anden item værdi)

Number Weather_Temperature "Outside Temp. (Yahoo) [%.1f °C]" <temperature> (Weather_Chart) { http="<[http://weather.yahooapis.com/forecastrss?w=638242&u=c:60000:XSLT(demo_yahoo_weather.xsl)]", ihc=">1234567" }

jeg har bare ingen ide om hvordan jeg udskifter linket, med en item værdi, eller om jeg skal hente værdien direkte fra mqtt.. 

Link til kommentar
Del på andre sites

8 svar på dette spørgsmål

Recommended Posts

  • 0
17 timer siden, Kandersen skrev:

har du afprøvet den?

Umiddelbart burde den virke, men jeg er bestemt ikke sikker. Ellers kan du nok gøre det i en rule i stedet.

Nej, jeg har jo ikke afprøvet den, da den jeg har fundet henter fra noget yahoo noget.. jeg var værdien som en item, som jeg vil putte over i ihc..

Link til kommentar
Del på andre sites

  • 0

Sorry to answer in english, but rules are not needed.

It depends how you are using MQTT and openHAB:

1. If you are using MQTT event bus binding configuration (no need to bind items to mqtt as they are binded automatically in event bus level) and you have openHAB item already which have e.g. temperature from MQTT (e.g. mqttTemperature), you just need to bind the item to IHC.

Number mqttTemperature "Temperature [%.1f °C]" { ihc=">1234567" }

So when ever mqttTemperature is updated, openHAB will send update to IHC resource 1234567. 

2. If you are using MQTT item configuration, then you need to add binding to IHC as well.

Number mqttTemperature "Temperature [%.1f °C] { mqtt"...", ihc=">1234567" }

 

@Kandersen and @Ejvind Hald can translate if needed :unsure:

 

Link til kommentar
Del på andre sites

  • 0
5 minutter siden, Pauli Anttila skrev:

Sorry to answer in english, but rules are not needed.

It depends how you are using MQTT and openHAB:

1. If you are using MQTT event bus binding configuration (no need to bind items to mqtt as they are binded automatically in event bus level) and you have openHAB item already which have e.g. temperature from MQTT (e.g. mqttTemperature), you just need to bind the item to IHC.


Number mqttTemperature "Temperature [%.1f °C]" { ihc=">1234567" }

So when ever mqttTemperature is updated, openHAB will send update to IHC resource 1234567. 

2. If you are using MQTT item configuration, then you need to add binding to IHC as well.


Number mqttTemperature "Temperature [%.1f °C] { mqtt"...", ihc=">1234567" }

 

@Kandersen and @Ejvind Hald can translate if needed :unsure:

 

I Think I understand, right now, I have my temperature from mqtt in itmes:

Number	th01_temp		"TH01 Temperatur[%.2f °C]"		<temperature>	(Sonoff)
	{ mqtt="<[broker:tele/th01/SENSOR:state:JSONPATH($.SI7021.Temperature)]"}

then i only need to add the IHC resource to this..? like:

Number	th01_temp		"TH01 Temperatur[%.2f °C]"		<temperature>	(Sonoff)
	{ mqtt="<[broker:tele/th01/SENSOR:state:JSONPATH($.SI7021.Temperature)]" ihc=">1234567" }

(IHC resource needs to be changed of cause) is that correct..?

Link til kommentar
Del på andre sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gæst
Svar på dette spørgsmål

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loader...
 Share

×
×
  • Tilføj...

Important Information

Privatlivspolitik og We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

1200x630bb.png

ok