Jump to content

Recommended Posts

HomeKitten v1.7 changelog:

  • Room bridge added. Every room is now separate bridge accessory. Device naming changed because we adding one room same time, so no more mess with names. Max bridges (rooms) count is 256. Each can have upto 100 devices.
  • Long room/devices names are propertly handling now
  • Identifiers cache implemented (can add or remove devices without bridge remove\add)
  • SwitchLock support added (Video gate open = Lock in HomeKit)
  • Battery level (low level warning) fixed and shows only for battery powered devices
  • Dead devices handling added. (Acting dead device will report an error and send wakeup request)
  • Critical bug for reading constant char fixed
  • Bridges confoguration file support added. Advanced users can make desired config manually. If not provided, automatic mode executing. Every room will appear as a bridge in HomeKit.

Room bridges are very usefull. You can create a room(bridge) for shared devices and then share it with your friends (gates for example)

 

Happy New Year

hcl_4560_lua_homekitten_17.tar.gz

  • Like 3
Link to post
Share on other sites
  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi, here is the guide how to flash custom recovery image for the HCL 4.140-4.150   Custom recovery allows to flash unsigned firmware in your HCL. This way we can add some new features or fix

BTW, good news for HC2 owners: HC2 NewOS recovery already has "signature ignore" mode and we can use stock recovery to flash custom firmwares. To enable it, need to create a file "/mnt/nvm/i

HomeKitten v1.7 changelog: Room bridge added. Every room is now separate bridge accessory. Device naming changed because we adding one room same time, so no more mess with names. Max bridges (ro

Posted Images

@jack.daniels thank you for your work!

 

I'm kinda new to the whole MQTT stuff. 

What additional configuration do I need to perform to receive Fibaro device messages over MQTT? 

 

HK_ENABLE_MQTT is set to 1

But when I connect to <FIBARO_ADDRESS>:1883 I only get following topic - "/fibaro/MyHome/connected"

 

Thank you!

 

P.S. Working after HCL restart

P.P.S And not working again, can't seem to  get it stable 🤷‍♂️

Edited by Deniss
Link to post
Share on other sites

Hi,

sad to hear you faced problems using mqtt bridge

All settings are load once at startup

Explain the problem more detailed plz

You can also check log messages in /var/log/messages

  • Thanks 1
Link to post
Share on other sites

Absolutely amazing work you've done there, @jack.daniels

 

I'm a very big fan of MQTT and I use it extensively. I have been waiting and hoping for years that Fibaro would add MQTT support to HC2. Maybe your work will inspire them.

Currently I'm no longer using HC2 as my home controller. I'm running Z-Wave2MQTT, Node-Red and Mosquitto broker on a dedicated smart home PC. I have about 40 Z-Wave devices and 30 different devices that use MQTT for communication.

 

If I could be bothered with rebuilding my whole setup, I would definitely try this and possibly move back to HC2. However, I would not feel comfortable using a custom firmware for a clients setup.

 

So, @Fibaro - if you guys are reading this: Please give some serious consideration to adding MQTT support natively. It would open up so many possibilities for integration that it would be insane.

 

Thank you again for sharing your work @jack.daniels

  • Thanks 1
Link to post
Share on other sites
  • 2 weeks later...

SOLVED -work ok in 0.17

I have "small" problem. I connect without problem to mosquito from any external client and work with any new topic or $SYS but I cant see any topic from HCL.

After turning log I see that your hcl2mqtt have problem to connect with mosquitto (no depends if allow anonymous is true like by default in your firmware or if set to false and user and password is written in global variables)  

 

1579480284: Warning: Address family not supported by protocol
1579480284: Warning: Mosquitto should not be run as root/administrator.
1579480307: New connection from 178.42.249.130 on port 1883.
1579480307: New client connected from 178.42.249.130 as mqtt_9c510133.870cc (c1, k60, u'mquser').
1579480436: New connection from 178.42.249.130 on port 1883.
1579480436: New client connected from 178.42.249.130 as e03d73da464548838a2a670d03d10b2e (c1, k60).
1579480616: Warning: Address family not supported by protocol
1579480616: Warning: Mosquitto should not be run as root/administrator.
1579480619: New connection from 127.0.0.1 on port 1883.
1579480619: Socket error on client <unknown>, disconnecting.
1579480624: New connection from 127.0.0.1 on port 1883.
1579480624: Socket error on client <unknown>, disconnecting.
1579480629: New connection from 127.0.0.1 on port 1883.

 

Edited by drboss
  • Like 1
Link to post
Share on other sites
  • 1 month later...

work fine, any problems. I use from first version and work fine without problems with memory consumption. I use mqtt for two way communication with others system and HomeKit for tests.

  • Like 1
Link to post
Share on other sites

generally memory is not a real Problem (lot of scenes / someplugins are problematic), one can however add "sync; echo 1 > /proc/sys/vm/drop_caches" to cleanup a bit right after Fibaro started all services. I was thinking about to add it to the "clear consumption" button ^^

  • Like 1
  • Thanks 1
Link to post
Share on other sites
4 hours ago, EliFib said:

@jack.daniels What about memory consumption? With all these services the HCL works fine? Any significant issues?

Its fine. In my observation (~3 monthes) with 10 bridges (rooms) added it was never got panic or hangs.

Actually I bought and set up my second HCL for my other location last days. That was the reason to upgrade to 4.580 :) 

I hope 4.580 will show same stability as 4.560. The only thing I would love to see is consumption overload fix from FIBARO R&D team. I had to disable all consumption reports for all my devices to keep the system stable >30 days

Link to post
Share on other sites

@jack.daniels did you tested or looked in firmware if net.HTTPClient() work in scenes in HCL or have any limitation because in /FibaroSceneAPI.lua  it be used?

I have small scene for update pollution info from my PM sensor and it's work on HC2 and update labels  but don't work on HCL of my fader?

the code is simple, but I can't check error depends of non /debugMessages for scenes on HCL.

Or I do other simple error :-(

 

local gdom="http://data.sensor.community/airrohr/v1/sensor/43690/"
local tdom="http://data.sensor.community/airrohr/v1/sensor/43691/"
HC = net.HTTPClient()
--local pollution
id = 3021



function GetData(gUrl)
HC:request(
   gUrl,
   { 
     success = function(response) 
--       print(response.data)
       pollution = json.decode(response.data)
            end,
     error =  httpError,
     options = {method = "GET" }
   }
 )
  return pollution
end

GetData(gdom)

--print(json.encode(pollution))
t=pollution[1] --sensordatavalues.value[1];
print('Pomiar: '..t.timestamp)
t1=t.sensordatavalues[1]
t2=t.sensordatavalues[2]

--print('1>>>> '..json.encode(t))
print('PM10:'..tonumber(t1.value))
print('PM25:'..tonumber(t2.value))

t1v=tonumber(t1.value)
t2v=tonumber(t2.value)
--[[< 50 ziel
< 90 pomar
< 180 czer
> 180 panic

2.5
<30 ziel
<55 pomar
<110 czer
> 110 panic
--]]
if t1v > 179 or t2v > 109 then w='Nie wychodzić bardzo złe powietrze' i=5 end
if t1v < 180 and t2v < 110 then w='złe powietrze' i=0 end
if t1v < 90 and t2v < 55 then w='średnie powietrze' i=1 end
if t1v < 50 and t2v < 30 then w='dobre powietrze' i=2 end
if t1v < 90 or t2v < 55 then w='dobre powietrze' i=3 end
--print(w)
--print(json.encode(t2.value)
fibaro:call(id, "setProperty", "ui.Label1.value", w)
fibaro:call(id, "setProperty", "ui.Label2.value", t1.value..' µg/m³')
fibaro:call(id, "setProperty", "ui.Label3.value", t2.value..' µg/m³')
fibaro:call(id, "setProperty", "ui.Label7.value", t.timestamp)

 

Link to post
Share on other sites

This isn't problem of HCL, the program work fine on FIbaroSceneApi on remote linux but on HCL and HC2 not. The problem occurs if server return json area like this:

date:
Tue, 17 Mar 2020 02:21:48 GMT
server:
Apache
strict-transport-security:
max-age=2592000
vary:
Accept-Encoding
access-control-allow-origin:
*
transfer-encoding:
chunked
content-type:
application/json

[{"location":{"altitude":"111.0","id":10319,"indoor":0,"country":"PL","exact_location":0,"longitude":"20.996","latitude":"52.206"},"sampling_rate":null,"id":6809540273,"timestamp":"2020-03-17 02:17:57","sensor":{"pin":"1","id":20322,"sensor_type":{"manufacturer":"Nova Fitness","name":"SDS011","id":14}},"sensordatavalues":[{"id":14481746496,"value":"32.97","value_type":"P1"},{"id":14481746532,"value":"11.57","value_type":"P2"}]}]

obraz.png.673a9a2785720a0c47e1468cea599140.png

 

for test I do:

if require then
  -- Load helpers to run offline
  require "json"
  require "LoadFibaroSceneAPI"

  NoHtml=false
end



local gdom="http://data.sensor.community/airrohr/v1/sensor/43690/"

function GetData(g_url)
--[[
  HC:request(
   gCalUrl,
   { 
     success = function(response) 
      print(response.data)
       polution = json.decode(response.data)
            end,
	  error = function(err)
					print('Icon error = ' .. err)
                end,
   
     options = {method = "GET" }
   }
 )
  return pollution
--]]

print('Get data: '..g_url)
local hc=net.HTTPClient({ timeout = 10000 })
hc:request(g_url , {
		success = function(response)
      print('Debug[1]: '..json.encode(response)) --in HCx return only [], on PC return full string
					if tonumber(response.status) == 200 or tonumber(response.status) == 201 or tonumber(response.status) == 202 then --200 added because server return with 200
						print("Get data at " .. os.date())
                  print('Responce.........: '..response.data)
                  
          				pollution = json.decode(response.data)
                  --polution = response.data
--        				sendPush(descriptif .. ' effectué')				
                    else
						print("Data Error " .. response.status)
 --                           print(response.data)
 --               polution = json.decode(response.data)
--         				sendPush('Erreur lors de la création du Backup - '.. response.status)
                    end
                end,
        error = function(err)
					print('Data error = ' .. err)
                end,
        options = {
				method = 'GET',
                headers = { 
--						["content-type"] = 'application/json', --same result as for text/plain
            ["content-type"] = 'text/plain',
				--		["Authorization"] = 'Basic '..password
                          },
                --data = datas
			}
}
)
--print('Return: '..json.encode(polution[1]))
  return pollution

end


GetData(gdom)

 

Link to post
Share on other sites
  • 4 weeks later...

Woow! I'm so happy that I found this thread! This looks like great idea and big thanx to @jack.daniels

 

I have a questions before I get it:

Can u tell me how to turn off HomeKit service? Can I do it? I just wanna have the rest: LUA and MQTT :)

 

And second one:

When I start HCL with this FW, can I restore backup taken from clean and normal version?

 

And last one:

Can it work with G. Assistant? Any plans for this in future?

  • Thanks 1
Link to post
Share on other sites
On 4/10/2020 at 9:14 PM, MrVValdi said:

Can u tell me how to turn off HomeKit service? Can I do it? I just wanna have the rest: LUA and MQTT :)

Sure, just disable it on the Variables panel

image.png.e0b3f239246d04626d62ca6c3e95f9f1.png

 

On 4/10/2020 at 9:14 PM, MrVValdi said:

When I start HCL with this FW, can I restore backup taken from clean and normal version?

Yes, sure. Changes in the FW are really minor.

On 4/10/2020 at 9:14 PM, MrVValdi said:

Can it work with G. Assistant? Any plans for this in future?

No plans

Link to post
Share on other sites

Hi @jack.daniels,

 

Just found this post. I think it is really very cool & Fibaro should pay your or hire you to join their software team!

I have few questions regarding flashing the firmware,

1. Does the version 4520 script for rooting HCL works on 4580?
2. the file type for version later than 4520 is .tar.tz instead of .img, so should i use the same steps to copy and run the code like below?
 

# dd bs=1M if=/tmp/hcl_4580_lua_homekitten_17.tar.gz of=/dev/mtdblock8

Thanks!!

Link to post
Share on other sites
17 hours ago, jamietang said:

Just found this post. I think it is really very cool & Fibaro should pay your or hire you to join their software team!

Thanks, but I prefer them to relase official support for this :)

 

17 hours ago, jamietang said:

1. Does the version 4520 script for rooting HCL works on 4580?

No, later FW versions they have fixed the security holes used for rooting, but you may always downgrade to the vulnerable fw to flash custom recovery, then flash any fw version You wish

 

17 hours ago, jamietang said:

2. the file type for version later than 4520 is .tar.tz instead of .img, so should i use the same steps to copy and run the code like below?

You mixed up, The dd used only once for flashing the custom recovery image (img). The firmware images (tar.gz) are fleshed by recovery mode web interface.

Happy hacking

Link to post
Share on other sites
2 hours ago, jack.daniels said:

Thanks, but I prefer them to relase official support for this :)

Yeah that will be the best, but i guess maybe they cant get it done because of Apple's certification criteria.

 

2 hours ago, jack.daniels said:

No, later FW versions they have fixed the security holes used for rooting, but you may always downgrade to the vulnerable fw to flash custom recovery, then flash any fw version You wish

You mixed up, The dd used only once for flashing the custom recovery image (img). The firmware images (tar.gz) are fleshed by recovery mode web interface.

Happy hacking


Ok, let me try and see if I understand it correctly. I'll need to downgrade it to 4520, then root it using the python script and then using recovery method and select 4580 file to update it to latest firmware. Is that correct?

Thanks again for your great work!

Link to post
Share on other sites
6 hours ago, jamietang said:

I'll need to downgrade it to 4520, then root it using the python script and then using recovery method and select 4580 file to update it to latest firmware. Is that correct?

Yes, this is correct

Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   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.


×
×
  • Create New...